{ "info": { "author": "Vince Forgione", "author_email": "vforgione@uchicago.edu", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Environment :: Console", "Environment :: Web Environment", "Intended Audience :: Developers", "Intended Audience :: Information Technology", "Intended Audience :: System Administrators", "License :: OSI Approved :: Apache Software License", "Natural Language :: English", "Operating System :: OS Independent", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7" ], "description": "# Plenario Client\n\nThis library serves as the official Python client to the\n[Plenario API](https://plenario.docs.apiary.io/#).\n\n## Requirements\n\nThis will run on Python 3.6 or better. Older versions of Python are not\nsupported. This library requires the installation of the\n[requests library](http://docs.python-requests.org/en/master/).\n\n## Usage\n\nThere are 2 API endpoints to Plenario:\n\n- The list endpoint that gets metadata about the data sets\n- The detail endpoint that gets records from the data sets\n\n### Accessing Data Set Records\n\nPlenario API responses are paginated, so naturally we need to provide users\nwith the ability to page through data as easily as possible. To do this, we\nprovide a simple iterator baked into the data sets:\n\n```python\nfrom plenario_client import PlenarioClient\n\nclient = PlenarioClient()\ndata_set = client.get_data_set('chicago-stuff')\nfor page in data_set:\n do_something_with_the(page)\n```\n\nThe _page_ here is the response object: it has a `meta` attribute that includes\nthe response metadata and a `records` attribute that includes the response\nbody -- a list of dictionaries.\n\n### Filtering with Query Parameters\n\nFiltering can be a little complicated depending on your needs. To handle that,\nwe've come up with a pretty simple solution. Somewhat similar to Django and\nElasticsearch-DSL we have an `F` class with which you construct and compose\nquery parameters to filter the results.\n\nThere are three operations:\n\n- Basic init with `F('field name', 'query operator', 'query value')`\n- Appending filters with `F() &= F()`\n- Overriding filters with `F() |= F()`\n\nHere's an example:\n\n```python\nfrom plenario_client import PlenarioClient, F\n\n# let's build a filter where we want items whose name is 'vince'\n# and their age is greater than or equal to 21:\nparams = F('name', 'eq', 'vince')\nparams &= ('age', 'ge', 21) # appending works with either an F or a tuple\n\n# let's now say we want to add 'bob' to the filter as well:\nparams &= ('name', 'eq', 'bob')\n\n# at this point if we inspect the filter we would get something like\n{\n 'name': [\n ('eq', 'vince'),\n ('eq', 'bob')\n ],\n 'age': ('ge', 21)\n}\n\n# now let's say that due to some logic happening in our script,\n# we've determined that neither 'vince' nor 'bob' are desireable\n# values -- we need 'alice':\nparams |= ('name', 'eq', 'alice')\n\n# now under the hood, our filter looks like\n{\n 'name': ('eq', 'alice'),\n 'age': ('ge', 21)\n}\n\n# now we're ready to fire off the request:\nclient = PlenarioClient()\nclient.describe_data_sets(params=params)\n```\n\n## Developing and Contributing\n\nTo run the tests locally:\n\n```bash\n$ pipenv install --dev\n$ pipenv run python -m pytest\n```\n\nTo push a relase to PyPI:\n\n```bash\n$ pipenv run python setup.py sdist bdist_wheel\n$ pipenv run twine upload dist/*\n```\n\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/UrbanCCD-UChicago/plenario-client-py", "keywords": "", "license": "Apache-2.0", "maintainer": "", "maintainer_email": "", "name": "plenario-client", "package_url": "https://pypi.org/project/plenario-client/", "platform": "", "project_url": "https://pypi.org/project/plenario-client/", "project_urls": { "Homepage": "https://github.com/UrbanCCD-UChicago/plenario-client-py" }, "release_url": "https://pypi.org/project/plenario-client/0.9.0/", "requires_dist": [ "requests" ], "requires_python": ">=3.6", "summary": "The Official Python Client of the Array of Things API", "version": "0.9.0" }, "last_serial": 4536143, "releases": { "0.9.0": [ { "comment_text": "", "digests": { "md5": "8b11e5262fb1f7cc674a4a645650d6dc", "sha256": "8badb231912a5dd7385536aa3ce3da1f6da54b72981ebd429f27e066c1bf404b" }, "downloads": -1, "filename": "plenario_client-0.9.0-py3-none-any.whl", "has_sig": false, "md5_digest": "8b11e5262fb1f7cc674a4a645650d6dc", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6", "size": 7151, "upload_time": "2018-11-27T22:55:30", "url": "https://files.pythonhosted.org/packages/c3/09/f9fb543bc9bf307777e4c37ef913635a2c1608ed6d45252f08bff3f31ff2/plenario_client-0.9.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "b48bd9741ec4f7387c0943d3f71167bf", "sha256": "2825e93c76c68136b3c7889199f7fb1fbd364f857050dc136596e130d9244006" }, "downloads": -1, "filename": "plenario-client-0.9.0.tar.gz", "has_sig": false, "md5_digest": "b48bd9741ec4f7387c0943d3f71167bf", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 5644, "upload_time": "2018-11-27T22:55:33", "url": "https://files.pythonhosted.org/packages/85/6b/7353b3a05bcb2b213f786365a50f46ac932f935bf5ef67dd4b97bf532960/plenario-client-0.9.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "8b11e5262fb1f7cc674a4a645650d6dc", "sha256": "8badb231912a5dd7385536aa3ce3da1f6da54b72981ebd429f27e066c1bf404b" }, "downloads": -1, "filename": "plenario_client-0.9.0-py3-none-any.whl", "has_sig": false, "md5_digest": "8b11e5262fb1f7cc674a4a645650d6dc", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6", "size": 7151, "upload_time": "2018-11-27T22:55:30", "url": "https://files.pythonhosted.org/packages/c3/09/f9fb543bc9bf307777e4c37ef913635a2c1608ed6d45252f08bff3f31ff2/plenario_client-0.9.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "b48bd9741ec4f7387c0943d3f71167bf", "sha256": "2825e93c76c68136b3c7889199f7fb1fbd364f857050dc136596e130d9244006" }, "downloads": -1, "filename": "plenario-client-0.9.0.tar.gz", "has_sig": false, "md5_digest": "b48bd9741ec4f7387c0943d3f71167bf", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 5644, "upload_time": "2018-11-27T22:55:33", "url": "https://files.pythonhosted.org/packages/85/6b/7353b3a05bcb2b213f786365a50f46ac932f935bf5ef67dd4b97bf532960/plenario-client-0.9.0.tar.gz" } ] }