{ "info": { "author": "OpenElections", "author_email": "openelections@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.4", "Topic :: Internet", "Topic :: Internet :: WWW/HTTP", "Topic :: Text Processing", "Topic :: Text Processing :: Markup :: XML" ], "description": "# Metadata\n\nA Python library that provides a thin wrapper to the [OpenElections Metadata API](http://docs.openelections.net/metadata-api/), which contains information about elections and the nature and availability of results data. The [API provides JSON endpoints for individual states](http://blog.openelections.net/an-improved-metadata-api/) and Metadata provides a way to search for and filter elections within a state.\n\nMetadata has been tested under Python 2.7.X.\n\n## Installation\n\n```\npip install openelections-metadata\n```\n\n## Usage\n\nMetadata offers two classes, `Request` and `Election`, for accessing the information in the API. You do not need an API key.\n\n### Request\n\nTo make a request, you'll need to specify the state you're interested in and any or none of three optional parameters: `start_date`, `end_date` and `offset`. Metadata uses the two dates as a range; it will search for elections on or after the `start_date` and on or before the `end_date`. For example, to make a request for elections that occurred in Maryland in 2014, you would do the following:\n\n```python\n>>> import metadata\n>>> r = metadata.Request('MD', '2014-01-01')\n```\n\n`Request` objects retain details about the parameters and also save the API url and the JSON response, if needed. Calling the `parse` method on the `Request` object creates individual `Election` objects, which have the same attributes as the API, with one addition - it has a `generated_filename` attribute that we use in the data processing pipeline.\n\n```python\n>>> elections = r.parse()\n>>> elections[0]\n\n>>> elections[0].start_date\nu'2014-11-04'\n>>> elections[0].race_type\nu'general'\n```\n\n## Running tests\n\n```\npython setup.py test\n```\n\n## Issues\n\nTo report an bug or request a feature, please [create a new issue](https://github.com/openelections/metadata/issues) describing the situation, providing as much detail as possible. We welcome contributions: feel free to fork the code and submit pull requests.\n\nLicense\n-------\n\nMetadata is released under the MIT License.", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://openelections.net", "keywords": "elections,metadata,api", "license": "", "maintainer": "", "maintainer_email": "", "name": "openelections-metadata", "package_url": "https://pypi.org/project/openelections-metadata/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/openelections-metadata/", "project_urls": { "Homepage": "http://openelections.net" }, "release_url": "https://pypi.org/project/openelections-metadata/0.1.1/", "requires_dist": [ "python-dateutil", "requests", "six" ], "requires_python": "", "summary": "A Python API wrapper for the OpenElections metadata API.", "version": "0.1.1" }, "last_serial": 1744909, "releases": { "0.1.0": [], "0.1.1": [ { "comment_text": "", "digests": { "md5": "422ada014c2cd94a233c1472c0dc9c6b", "sha256": "6bf9d966eee9f3dab2152e0697e3e8f9049375666264bb12bd8cd3edebf24c06" }, "downloads": -1, "filename": "openelections_metadata-0.1.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "422ada014c2cd94a233c1472c0dc9c6b", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 6413, "upload_time": "2015-09-30T01:14:17", "url": "https://files.pythonhosted.org/packages/97/8f/36d64fc0a33ba8c2909168ea23b367ff7cc548c5d31aa31235be5f4bb5b1/openelections_metadata-0.1.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "d0e22b8febe4f2fc9379a1a8124bbf52", "sha256": "b6e31348126204adaa882ce04926dcc3c962a5f201670064246c0691589deeef" }, "downloads": -1, "filename": "openelections-metadata-0.1.1.tar.gz", "has_sig": false, "md5_digest": "d0e22b8febe4f2fc9379a1a8124bbf52", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3367, "upload_time": "2015-09-30T01:15:00", "url": "https://files.pythonhosted.org/packages/ba/55/99d852d3c5fd802db0afc83bcf04d6d8037f9c4a3be0acaa2802a43f36e1/openelections-metadata-0.1.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "422ada014c2cd94a233c1472c0dc9c6b", "sha256": "6bf9d966eee9f3dab2152e0697e3e8f9049375666264bb12bd8cd3edebf24c06" }, "downloads": -1, "filename": "openelections_metadata-0.1.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "422ada014c2cd94a233c1472c0dc9c6b", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 6413, "upload_time": "2015-09-30T01:14:17", "url": "https://files.pythonhosted.org/packages/97/8f/36d64fc0a33ba8c2909168ea23b367ff7cc548c5d31aa31235be5f4bb5b1/openelections_metadata-0.1.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "d0e22b8febe4f2fc9379a1a8124bbf52", "sha256": "b6e31348126204adaa882ce04926dcc3c962a5f201670064246c0691589deeef" }, "downloads": -1, "filename": "openelections-metadata-0.1.1.tar.gz", "has_sig": false, "md5_digest": "d0e22b8febe4f2fc9379a1a8124bbf52", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3367, "upload_time": "2015-09-30T01:15:00", "url": "https://files.pythonhosted.org/packages/ba/55/99d852d3c5fd802db0afc83bcf04d6d8037f9c4a3be0acaa2802a43f36e1/openelections-metadata-0.1.1.tar.gz" } ] }