{ "info": { "author": "Open Knowledge Foundation", "author_email": "info@okfn.org", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "Intended Audience :: Science/Research", "License :: OSI Approved :: GNU Lesser General Public License v3 or later (LGPLv3+)", "Operating System :: OS Independent", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Topic :: Scientific/Engineering :: Information Analysis", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "# tableschema-pandas-py\n\n[![Travis](https://img.shields.io/travis/frictionlessdata/tableschema-pandas-py/master.svg)](https://travis-ci.org/frictionlessdata/tableschema-pandas-py)\n[![Coveralls](http://img.shields.io/coveralls/frictionlessdata/tableschema-pandas-py.svg?branch=master)](https://coveralls.io/r/frictionlessdata/tableschema-pandas-py?branch=master)\n[![PyPi](https://img.shields.io/pypi/v/tableschema-pandas.svg)](https://pypi.python.org/pypi/tableschema-pandas)\n[![Github](https://img.shields.io/badge/github-master-brightgreen)](https://github.com/frictionlessdata/tableschema-pandas-py)\n[![Gitter](https://img.shields.io/gitter/room/frictionlessdata/chat.svg)](https://gitter.im/frictionlessdata/chat)\n\nGenerate and load Pandas data frames [Table Schema](http://specs.frictionlessdata.io/table-schema/) descriptors.\n\n## Features\n\n- implements `tableschema.Storage` interface\n\n## Contents\n\n\n\n - [Getting Started](#getting-started)\n - [Installation](#installation)\n - [Example](#example)\n - [Documentation](#documentation)\n - [Storage](#storage)\n - [Contributing](#contributing)\n - [Changelog](#changelog)\n\n\n\n## Getting Started\n\n### Installation\n\nThe package use semantic versioning. It means that major versions could include breaking changes. It's highly recommended to specify `package` version range in your `setup/requirements` file e.g. `package>=1.0,<2.0`.\n\n```\n$ pip install tableschema-pandas\n```\n\n### Example\n\nCode examples in this readme requires Python 3.3+ interpreter. You could see even more example in [examples](https://github.com/frictionlessdata/tableschema-pandas-py/tree/master/examples) directory.\n\nYou can easily load resources from a data package as Pandas data frames by simply using `datapackage.push_datapackage` function:\n\n```python\n>>> import datapackage\n\n>>> data_url = 'http://data.okfn.org/data/core/country-list/datapackage.json'\n>>> storage = datapackage.push_datapackage(data_url, 'pandas')\n\n>>> storage.buckets\n['data___data']\n\n>>> type(storage['data___data'])\n\n\n>>> storage['data___data'].head()\n Name Code\n0 Afghanistan AF\n1 \u00c5land Islands AX\n2 Albania AL\n3 Algeria DZ\n4 American Samoa AS\n```\n\nAlso it is possible to pull your existing data frame into a data package:\n\n```python\n>>> datapackage.pull_datapackage('/tmp/datapackage.json', 'country_list', 'pandas', tables={\n... 'data': storage['data___data'],\n... })\nStorage\n```\n\n## Documentation\n\nThe whole public API of this package is described here and follows semantic versioning rules. Everyting outside of this readme are private API and could be changed without any notification on any new version.\n\n### Storage\n\nPackage implements [Tabular Storage](https://github.com/frictionlessdata/tableschema-py#storage) interface (see full documentation on the link):\n\n![Storage](https://i.imgur.com/RQgrxqp.png)\n\nThis driver provides an additional API:\n\n#### `Storage(dataframes=[])`\n\n- `dataframes (object[])` - list of storage dataframes\n\nWe can get storage this way:\n\n```python\n>>> from tableschema_pandas import Storage\n\n>>> storage = Storage()\n```\n\nStorage works as a container for Pandas data frames. You can define new data frame inside storage using `storage.create` method:\n\n```python\n>>> storage.create('data', {\n... 'primaryKey': 'id',\n... 'fields': [\n... {'name': 'id', 'type': 'integer'},\n... {'name': 'comment', 'type': 'string'},\n... ]\n... })\n\n>>> storage.buckets\n['data']\n\n>>> storage['data'].shape\n(0, 0)\n```\n\nUse `storage.write` to populate data frame with data:\n\n```python\n>>> storage.write('data', [(1, 'a'), (2, 'b')])\n\n>>> storage['data']\nid comment\n1 a\n2 b\n```\n\nAlso you can use [tabulator](https://github.com/frictionlessdata/tabulator-py) to populate data frame from external data file. As you see, subsequent writes simply appends new data on top of existing ones:\n\n```python\n>>> import tabulator\n\n>>> with tabulator.Stream('data/comments.csv', headers=1) as stream:\n... storage.write('data', stream)\n\n>>> storage['data']\nid comment\n1 a\n2 b\n1 good\n```\n\n## Contributing\n\nThe project follows the [Open Knowledge International coding standards](https://github.com/okfn/coding-standards).\n\nRecommended way to get started is to create and activate a project virtual environment.\nTo install package and development dependencies into active environment:\n\n```\n$ make install\n```\n\nTo run tests with linting and coverage:\n\n```bash\n$ make test\n```\n\nFor linting `pylama` configured in `pylama.ini` is used. On this stage it's already\ninstalled into your environment and could be used separately with more fine-grained control\nas described in documentation - https://pylama.readthedocs.io/en/latest/.\n\nFor example to sort results by error type:\n\n```bash\n$ pylama --sort \n```\n\nFor testing `tox` configured in `tox.ini` is used.\nIt's already installed into your environment and could be used separately with more fine-grained control as described in documentation - https://testrun.org/tox/latest/.\n\nFor example to check subset of tests against Python 2 environment with increased verbosity.\nAll positional arguments and options after `--` will be passed to `py.test`:\n\n```bash\ntox -e py27 -- -v tests/\n```\n\nUnder the hood `tox` uses `pytest` configured in `pytest.ini`, `coverage`\nand `mock` packages. This packages are available only in tox envionments.\n\n## Changelog\n\nHere described only breaking and the most important changes. The full changelog and documentation for all released versions could be found in nicely formatted [commit history](https://github.com/frictionlessdata/tableschema-pandas-py/commits/master).\n\n#### v1.1\n\n- Added support for composite primary keys (loading to pandas)\n\n#### v1.0\n\n- Initial driver implementation\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/frictionlessdata/tableschema-pandas-py", "keywords": "frictionless data,datapackage,pandas", "license": "LGPLv3+", "maintainer": "", "maintainer_email": "", "name": "tableschema-pandas", "package_url": "https://pypi.org/project/tableschema-pandas/", "platform": "", "project_url": "https://pypi.org/project/tableschema-pandas/", "project_urls": { "Homepage": "https://github.com/frictionlessdata/tableschema-pandas-py" }, "release_url": "https://pypi.org/project/tableschema-pandas/1.1.0/", "requires_dist": [ "six (>=1.9)", "pandas (>=0.18)", "tabulator (>=1.0)", "tableschema (>=1.1)", "isodate (>=0.6)", "mock ; extra == 'develop'", "pylama ; extra == 'develop'", "pytest ; extra == 'develop'", "pytest-cov ; extra == 'develop'", "tox ; extra == 'develop'" ], "requires_python": "", "summary": "Generate Pandas data frames, load and extract data, based on JSON Table Schema descriptors.", "version": "1.1.0", "yanked": false, "yanked_reason": null }, "last_serial": 6029985, "releases": { "0.6.0": [ { "comment_text": "", "digests": { "md5": "712e4919a1e93bb61a8de5253d231d4b", "sha256": "f9c1a567f2c6c6469c3c5bc9a1db96dd187960ccd528e93720ae0e08b4e28ee3" }, "downloads": -1, "filename": "tableschema_pandas-0.6.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "712e4919a1e93bb61a8de5253d231d4b", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 11086, "upload_time": "2017-09-28T07:40:25", "upload_time_iso_8601": "2017-09-28T07:40:25.821025Z", "url": "https://files.pythonhosted.org/packages/04/5a/434093806ab1a66db46b4cd3222543693a39173b2ace377da9bb1ead580f/tableschema_pandas-0.6.0-py2.py3-none-any.whl", "yanked": false, "yanked_reason": null }, { "comment_text": "", "digests": { "md5": "5f2eb920a6e8335f08af3b32ae05b225", "sha256": "4d1bfb120146b3313e7187eee16dc305599be4c37e0d571fef8ee12531eed21d" }, "downloads": -1, "filename": "tableschema-pandas-0.6.0.tar.gz", "has_sig": false, "md5_digest": "5f2eb920a6e8335f08af3b32ae05b225", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11833, "upload_time": "2017-09-28T07:40:27", "upload_time_iso_8601": "2017-09-28T07:40:27.367348Z", "url": "https://files.pythonhosted.org/packages/3d/54/22d69fc1b60beac80747fa403ba1efad218c4515b60c631461ca3e0c5add/tableschema-pandas-0.6.0.tar.gz", "yanked": false, "yanked_reason": null } ], "0.6.1": [ { "comment_text": "", "digests": { "md5": "c79f848a65bbdc8529409b08a9df0619", "sha256": "b3647d17d8c86ddf6bf70446c8340c33c11757de8a59cee849f2c741dc315090" }, "downloads": -1, "filename": "tableschema_pandas-0.6.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "c79f848a65bbdc8529409b08a9df0619", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 11272, "upload_time": "2017-09-30T18:00:48", "upload_time_iso_8601": "2017-09-30T18:00:48.171223Z", "url": "https://files.pythonhosted.org/packages/5d/09/1c9595766292a148bc463408e30b55c3e099bb4694be083d685d8c43193c/tableschema_pandas-0.6.1-py2.py3-none-any.whl", "yanked": false, "yanked_reason": null }, { "comment_text": "", "digests": { "md5": "a9fcd7537251b6dd5a911b3149248cbb", "sha256": "ee374f86fb2b5f79a2f16961dc049f5985f7ed6e936d3f10fb6804ed0e712a4c" }, "downloads": -1, "filename": "tableschema-pandas-0.6.1.tar.gz", "has_sig": false, "md5_digest": "a9fcd7537251b6dd5a911b3149248cbb", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11956, "upload_time": "2017-09-30T18:00:49", "upload_time_iso_8601": "2017-09-30T18:00:49.096004Z", "url": "https://files.pythonhosted.org/packages/e5/3c/df78f653532e4c4851b32f814e8c79a4a48120b394bd1d97acb4659a5f6e/tableschema-pandas-0.6.1.tar.gz", "yanked": false, "yanked_reason": null } ], "0.6.3": [ { "comment_text": "", "digests": { "md5": "7fd21bc083e2dc222ba9ca757eeab478", "sha256": "6a66d1c7737af29b7377bd1e6a25474a65323e3132e453585247aecb0fa649a8" }, "downloads": -1, "filename": "tableschema_pandas-0.6.3-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "7fd21bc083e2dc222ba9ca757eeab478", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 10749, "upload_time": "2019-09-21T09:13:30", "upload_time_iso_8601": "2019-09-21T09:13:30.826073Z", "url": "https://files.pythonhosted.org/packages/2b/97/1e117294561b92c15c25f45d9c3ed97c5bc9c4fabe6b358694dc4053951d/tableschema_pandas-0.6.3-py2.py3-none-any.whl", "yanked": false, "yanked_reason": null }, { "comment_text": "", "digests": { "md5": "e2297cd15bc54449323cf664ae952ffa", "sha256": "6817b0b7055ea0bae018d4d970ca31045dc8a0aa567827382aa0c3e1130b78c3" }, "downloads": -1, "filename": "tableschema-pandas-0.6.3.tar.gz", "has_sig": false, "md5_digest": "e2297cd15bc54449323cf664ae952ffa", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10847, "upload_time": "2019-09-21T09:13:32", "upload_time_iso_8601": "2019-09-21T09:13:32.445114Z", "url": "https://files.pythonhosted.org/packages/83/8b/da04b836858b85c0e470d538561ddc930a38ccb8d8fa0e2438fb093fb33a/tableschema-pandas-0.6.3.tar.gz", "yanked": false, "yanked_reason": null } ], "1.0.0": [ { "comment_text": "", "digests": { "md5": "9b6a73588c076358ea946533636bab11", "sha256": "1a39ec2a5b28f62a29c61f6b4253b6718b569dea7a2137125af29eb7e592edd0" }, "downloads": -1, "filename": "tableschema_pandas-1.0.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "9b6a73588c076358ea946533636bab11", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 10755, "upload_time": "2019-09-21T11:41:36", "upload_time_iso_8601": "2019-09-21T11:41:36.733617Z", "url": "https://files.pythonhosted.org/packages/89/15/ba3b260d2a0fb22eabf910a6bcb2c784eaf018a4e9557e41fc9b199af91b/tableschema_pandas-1.0.0-py2.py3-none-any.whl", "yanked": false, "yanked_reason": null }, { "comment_text": "", "digests": { "md5": "2fcd83132994a814761c81102d1ecc35", "sha256": "f46114b06ebf58d89c618ac29c8fb39c7b7debb7e013b9aa1e89fc93c399b9fb" }, "downloads": -1, "filename": "tableschema-pandas-1.0.0.tar.gz", "has_sig": false, "md5_digest": "2fcd83132994a814761c81102d1ecc35", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10858, "upload_time": "2019-09-21T11:41:38", "upload_time_iso_8601": "2019-09-21T11:41:38.303378Z", "url": "https://files.pythonhosted.org/packages/8b/ad/d6a798742784fd34d73670d316a546e96794d669258e7daa92a0c32ee6cc/tableschema-pandas-1.0.0.tar.gz", "yanked": false, "yanked_reason": null } ], "1.1.0": [ { "comment_text": "", "digests": { "md5": "ce1f37691690d37fd151d5b0af7b224f", "sha256": "e053c72be8d821331595de1cf08fedcf23aebdc832364d60bc98043fe0ef7cb7" }, "downloads": -1, "filename": "tableschema_pandas-1.1.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "ce1f37691690d37fd151d5b0af7b224f", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 10808, "upload_time": "2019-10-25T14:34:35", "upload_time_iso_8601": "2019-10-25T14:34:35.908474Z", "url": "https://files.pythonhosted.org/packages/3d/10/51e855b1a92a9d0bb23f349ba44df0685aeb7581df23f148e034bb05f1ae/tableschema_pandas-1.1.0-py2.py3-none-any.whl", "yanked": false, "yanked_reason": null }, { "comment_text": "", "digests": { "md5": "1ee3db009481b2be32203c1b40298097", "sha256": "13ab08fc83069d2581c9d6a94876d911b219e8e3448c497de57f59e69a6ed1e0" }, "downloads": -1, "filename": "tableschema-pandas-1.1.0.tar.gz", "has_sig": false, "md5_digest": "1ee3db009481b2be32203c1b40298097", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11160, "upload_time": "2019-10-25T14:34:37", "upload_time_iso_8601": "2019-10-25T14:34:37.067271Z", "url": "https://files.pythonhosted.org/packages/e0/f6/1f8f92db63bc304de683a8c1acf72baa64eaf993dfa2161a7a5cd7cbc715/tableschema-pandas-1.1.0.tar.gz", "yanked": false, "yanked_reason": null } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "ce1f37691690d37fd151d5b0af7b224f", "sha256": "e053c72be8d821331595de1cf08fedcf23aebdc832364d60bc98043fe0ef7cb7" }, "downloads": -1, "filename": "tableschema_pandas-1.1.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "ce1f37691690d37fd151d5b0af7b224f", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 10808, "upload_time": "2019-10-25T14:34:35", "upload_time_iso_8601": "2019-10-25T14:34:35.908474Z", "url": "https://files.pythonhosted.org/packages/3d/10/51e855b1a92a9d0bb23f349ba44df0685aeb7581df23f148e034bb05f1ae/tableschema_pandas-1.1.0-py2.py3-none-any.whl", "yanked": false, "yanked_reason": null }, { "comment_text": "", "digests": { "md5": "1ee3db009481b2be32203c1b40298097", "sha256": "13ab08fc83069d2581c9d6a94876d911b219e8e3448c497de57f59e69a6ed1e0" }, "downloads": -1, "filename": "tableschema-pandas-1.1.0.tar.gz", "has_sig": false, "md5_digest": "1ee3db009481b2be32203c1b40298097", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11160, "upload_time": "2019-10-25T14:34:37", "upload_time_iso_8601": "2019-10-25T14:34:37.067271Z", "url": "https://files.pythonhosted.org/packages/e0/f6/1f8f92db63bc304de683a8c1acf72baa64eaf993dfa2161a7a5cd7cbc715/tableschema-pandas-1.1.0.tar.gz", "yanked": false, "yanked_reason": null } ], "vulnerabilities": [] }