Name | google-civic-information-api JSON |
Version |
1.0.0
JSON |
| download |
home_page | |
Summary | A python wrapper for Google's Civic Information API |
upload_time | 2023-06-07 12:54:13 |
maintainer | |
docs_url | None |
author | Matthew Mathur |
requires_python | >=3.7 |
license | BSD 3-Clause License Copyright (c) 2023, Matthew Mathur Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
keywords |
civic-information-api
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# google-civic-information-api-py
![PyPI](https://img.shields.io/pypi/v/google-civic-information-api?color=blue&label=PyPi&style=plastic)
![GitHub](https://img.shields.io/github/license/k0pak4/google-civic-information-api-py?label=License&style=plastic)
![PyPI - Python Version](https://img.shields.io/pypi/pyversions/google-civic-information-api?label=Python&style=plastic)
![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/k0pak4/google-civic-information-api-py/run-unit-tests.yml?style=plastic)
google-civic-information-api-py is a Python wrapper for [Google's Civic Information API](https://developers.google.com/civic-information/docs/v2).
## Installation
### Installing with Pip from Pypi
```bash
pip install google-civic-information-api
```
### Installing with Pip Locally
```bash
git clone https://github.com/k0pak4/google-civic-information-api-py.git
cd google-civic-information-api-py
pip install .
```
## Usage
The google-civic-information-api has three modules: divisions, elections, and representatives. Each module has a few functions, examples of each are provided below.
### divisions
```python
import os
from google_civic_information_api import divisions
civic_api_key = os.environ["TEST_CIVIC_INFO_API_KEY"]
# Search Divisions by Address
search_results = divisions.search(civic_api_key, "District of Columbia")
print(search_results.json())
```
### elections
```python
import os
from google_civic_information_api import elections
civic_api_key = os.environ["TEST_CIVIC_INFO_API_KEY"]
# Search all Elections
elections_results = elections.elections(civic_api_key)
print(elections_results.json())
```
### representatives
```python
import os
from google_civic_information_api import
civic_api_key = os.environ["TEST_CIVIC_INFO_API_KEY"]
# Retrieve all country level representatives from D.C. by searching by Address
dc_results = representatives.representative_info_by_address(
civic_api_key, "20001", recursive=True, levels="country")
print(dc_results.json())
# Retrieve all country level representatives from D.C. by searching by OCD Division
dc_results = representatives.representative_info_by_division(
civic_api_key, "ocd-division/country:us/district:dc", recursive=True, levels="country")
print(dc_results.json())
```
## Contributing
Refer to the [Contributing Guide](https://github.com/k0pak4/google-civic-information-api-py/blob/main/CONTRIBUTING.md) for details on opening issues, pull requests, and development considerations.
## Security
Refer to the [Security Policy](https://github.com/k0pak4/google-civic-information-api-py/blob/main/SECURITY.md) for details on supported versions, reporting vulnerabilities, and security considerations.
## License
[BSD 3-Clause License](https://github.com/k0pak4/google-civic-information-api-py/blob/main/LICENSE)
Raw data
{
"_id": null,
"home_page": "",
"name": "google-civic-information-api",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.7",
"maintainer_email": "",
"keywords": "civic-information-api",
"author": "Matthew Mathur",
"author_email": "",
"download_url": "https://files.pythonhosted.org/packages/83/ab/ea1277bf6195d04a318ee8fc76864c1a3095f8938debb39ca0f071a6138b/google-civic-information-api-1.0.0.tar.gz",
"platform": null,
"description": "# google-civic-information-api-py\n![PyPI](https://img.shields.io/pypi/v/google-civic-information-api?color=blue&label=PyPi&style=plastic)\n![GitHub](https://img.shields.io/github/license/k0pak4/google-civic-information-api-py?label=License&style=plastic)\n![PyPI - Python Version](https://img.shields.io/pypi/pyversions/google-civic-information-api?label=Python&style=plastic)\n![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/k0pak4/google-civic-information-api-py/run-unit-tests.yml?style=plastic)\n\ngoogle-civic-information-api-py is a Python wrapper for [Google's Civic Information API](https://developers.google.com/civic-information/docs/v2).\n\n## Installation\n\n### Installing with Pip from Pypi\n\n```bash\npip install google-civic-information-api\n```\n\n### Installing with Pip Locally\n```bash\ngit clone https://github.com/k0pak4/google-civic-information-api-py.git\ncd google-civic-information-api-py\npip install .\n```\n\n## Usage\nThe google-civic-information-api has three modules: divisions, elections, and representatives. Each module has a few functions, examples of each are provided below.\n\n### divisions\n```python\nimport os\nfrom google_civic_information_api import divisions\n\ncivic_api_key = os.environ[\"TEST_CIVIC_INFO_API_KEY\"]\n\n# Search Divisions by Address\nsearch_results = divisions.search(civic_api_key, \"District of Columbia\")\nprint(search_results.json())\n```\n\n### elections\n```python\nimport os\nfrom google_civic_information_api import elections\n\ncivic_api_key = os.environ[\"TEST_CIVIC_INFO_API_KEY\"]\n\n# Search all Elections\nelections_results = elections.elections(civic_api_key)\nprint(elections_results.json())\n```\n\n### representatives\n```python\nimport os\nfrom google_civic_information_api import \n\ncivic_api_key = os.environ[\"TEST_CIVIC_INFO_API_KEY\"]\n\n# Retrieve all country level representatives from D.C. by searching by Address\ndc_results = representatives.representative_info_by_address(\n civic_api_key, \"20001\", recursive=True, levels=\"country\")\nprint(dc_results.json())\n\n# Retrieve all country level representatives from D.C. by searching by OCD Division\ndc_results = representatives.representative_info_by_division(\n civic_api_key, \"ocd-division/country:us/district:dc\", recursive=True, levels=\"country\")\nprint(dc_results.json())\n```\n\n## Contributing\nRefer to the [Contributing Guide](https://github.com/k0pak4/google-civic-information-api-py/blob/main/CONTRIBUTING.md) for details on opening issues, pull requests, and development considerations.\n\n## Security\nRefer to the [Security Policy](https://github.com/k0pak4/google-civic-information-api-py/blob/main/SECURITY.md) for details on supported versions, reporting vulnerabilities, and security considerations.\n\n## License\n\n[BSD 3-Clause License](https://github.com/k0pak4/google-civic-information-api-py/blob/main/LICENSE)\n",
"bugtrack_url": null,
"license": "BSD 3-Clause License Copyright (c) 2023, Matthew Mathur Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ",
"summary": "A python wrapper for Google's Civic Information API",
"version": "1.0.0",
"project_urls": {
"Homepage": "https://github.com/k0pak4/google-civic-information-api-py"
},
"split_keywords": [
"civic-information-api"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "930ff961b0cbbd1bd7c8f408ae327560ca305a803fd5d18b7ca810d47ed1b316",
"md5": "091a04a79d5004544aea3d782381764e",
"sha256": "8944390c17970e1a8bb8e3e2dd0eac6e09be0a1e9e14dd483931bc22872762fa"
},
"downloads": -1,
"filename": "google_civic_information_api-1.0.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "091a04a79d5004544aea3d782381764e",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.7",
"size": 6789,
"upload_time": "2023-06-07T12:54:12",
"upload_time_iso_8601": "2023-06-07T12:54:12.261251Z",
"url": "https://files.pythonhosted.org/packages/93/0f/f961b0cbbd1bd7c8f408ae327560ca305a803fd5d18b7ca810d47ed1b316/google_civic_information_api-1.0.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "83abea1277bf6195d04a318ee8fc76864c1a3095f8938debb39ca0f071a6138b",
"md5": "a779a71c5fd483359731d2255dc6c06b",
"sha256": "7c7427c8b79bbf8af9080752d90e5ccb9439da9ffad18f6915adf99f2cacf9c2"
},
"downloads": -1,
"filename": "google-civic-information-api-1.0.0.tar.gz",
"has_sig": false,
"md5_digest": "a779a71c5fd483359731d2255dc6c06b",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.7",
"size": 6255,
"upload_time": "2023-06-07T12:54:13",
"upload_time_iso_8601": "2023-06-07T12:54:13.369649Z",
"url": "https://files.pythonhosted.org/packages/83/ab/ea1277bf6195d04a318ee8fc76864c1a3095f8938debb39ca0f071a6138b/google-civic-information-api-1.0.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-06-07 12:54:13",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "k0pak4",
"github_project": "google-civic-information-api-py",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "google-civic-information-api"
}