pyoutbreaksnearme


Namepyoutbreaksnearme JSON
Version 2023.12.0 PyPI version JSON
download
home_pagehttps://github.com/bachya/pyoutbreaksnearme
SummaryA Python3 API for Outbreaks Near Me
upload_time2023-12-18 02:21:32
maintainer
docs_urlNone
authorAaron Bach
requires_python>=3.10,<4.0
licenseMIT
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # 🚰 pyoutbreaksnearme: A Python3 API for Outbreaks Near Me

[![CI][ci-badge]][ci]
[![PyPI][pypi-badge]][pypi]
[![Version][version-badge]][version]
[![License][license-badge]][license]
[![Code Coverage][codecov-badge]][codecov]
[![Maintainability][maintainability-badge]][maintainability]

<a href="https://www.buymeacoffee.com/bachya1208P" target="_blank"><img src="https://cdn.buymeacoffee.com/buttons/default-orange.png" alt="Buy Me A Coffee" height="41" width="174"></a>

`pyoutbreaksnearme` is a Python3, asyncio-based library for getting data from
[Outbreaks Near Me][outbreaksnearme].

- [Installation](#installation)
- [Python Versions](#python-versions)
- [Usage](#usage)
- [Contributing](#contributing)

# Installation

```bash
pip install pyoutbreaksnearme
```

# Python Versions

`pyoutbreaksnearme` is currently supported on:

- Python 3.10
- Python 3.11
- Python 3.12

# Usage

```python
import asyncio

from aiohttp import ClientSession

from pyoutbreaksnearme import Client


async def main() -> None:
    """Create the aiohttp session and run the example."""
    client = await Client()

    # Get user-reported data for the location closest to a latitude/longitude:
    nearest_user_data = await client.user_data.async_get_nearest_by_coordinates(
        40.7152, -73.9877
    )

    # Get totals for user-reported data:
    user_totals_data = await client.user_data.async_get_totals()

    # Get CDC data for the location closest to a latitude/longitude:
    nearest_user_data = await client.cdc_data.async_get_nearest_by_coordinates(
        40.7152, -73.9877
    )


asyncio.run(main())
```

By default, the library creates a new connection to Outbreaks Near Me with each
coroutine. If you are calling a large number of coroutines (or merely want to squeeze
out every second of runtime savings possible), an [`aiohttp`][aiohttp] `ClientSession` can
be used for connection pooling:

```python
import asyncio

from aiohttp import ClientSession

from pyoutbreaksnearme import Client


async def main() -> None:
    """Create the aiohttp session and run the example."""
    async with ClientSession() as session:
        # Create a Notion API client:
        client = await Client(session=session)

        # Get to work...


asyncio.run(main())
```

# Contributing

Thanks to all of [our contributors][contributors] so far!

1. [Check for open features/bugs][issues] or [initiate a discussion on one][new-issue].
2. [Fork the repository][fork].
3. (_optional, but highly recommended_) Create a virtual environment: `python3 -m venv .venv`
4. (_optional, but highly recommended_) Enter the virtual environment: `source ./.venv/bin/activate`
5. Install the dev environment: `script/setup`
6. Code your new feature or bug fix on a new branch.
7. Write tests that cover your new functionality.
8. Run tests and ensure 100% code coverage: `poetry run pytest --cov pyoutbreaksnearme tests`
9. Update `README.md` with any new documentation.
10. Submit a pull request!

[aiohttp]: https://github.com/aio-libs/aiohttp
[ci-badge]: https://github.com/bachya/pyoutbreaksnearme/workflows/CI/badge.svg
[ci]: https://github.com/bachya/pyoutbreaksnearme/actions
[codecov-badge]: https://codecov.io/gh/bachya/pyoutbreaksnearme/branch/dev/graph/badge.svg
[codecov]: https://codecov.io/gh/bachya/pyoutbreaksnearme
[contributors]: https://github.com/bachya/pyoutbreaksnearme/graphs/contributors
[fork]: https://github.com/bachya/pyoutbreaksnearme/fork
[issues]: https://github.com/bachya/pyoutbreaksnearme/issues
[license-badge]: https://img.shields.io/pypi/l/pyoutbreaksnearme.svg
[license]: https://github.com/bachya/pyoutbreaksnearme/blob/main/LICENSE
[maintainability-badge]: https://api.codeclimate.com/v1/badges/4707fac476249d515511/maintainability
[maintainability]: https://codeclimate.com/github/bachya/pyoutbreaksnearme/maintainability
[new-issue]: https://github.com/bachya/pyoutbreaksnearme/issues/new
[new-issue]: https://github.com/bachya/pyoutbreaksnearme/issues/new
[outbreaksnearme]: https://outbreaksnearme.org
[pypi-badge]: https://img.shields.io/pypi/v/pyoutbreaksnearme.svg
[pypi]: https://pypi.python.org/pypi/pyoutbreaksnearme
[version-badge]: https://img.shields.io/pypi/pyversions/pyoutbreaksnearme.svg
[version]: https://pypi.python.org/pypi/pyoutbreaksnearme

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/bachya/pyoutbreaksnearme",
    "name": "pyoutbreaksnearme",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.10,<4.0",
    "maintainer_email": "",
    "keywords": "",
    "author": "Aaron Bach",
    "author_email": "bachya1208@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/83/2b/4220f94d8d6f6d81822e5a5caf58399e807ca415e8b4c7f93979cca30521/pyoutbreaksnearme-2023.12.0.tar.gz",
    "platform": null,
    "description": "# \ud83d\udeb0 pyoutbreaksnearme: A Python3 API for Outbreaks Near Me\n\n[![CI][ci-badge]][ci]\n[![PyPI][pypi-badge]][pypi]\n[![Version][version-badge]][version]\n[![License][license-badge]][license]\n[![Code Coverage][codecov-badge]][codecov]\n[![Maintainability][maintainability-badge]][maintainability]\n\n<a href=\"https://www.buymeacoffee.com/bachya1208P\" target=\"_blank\"><img src=\"https://cdn.buymeacoffee.com/buttons/default-orange.png\" alt=\"Buy Me A Coffee\" height=\"41\" width=\"174\"></a>\n\n`pyoutbreaksnearme` is a Python3, asyncio-based library for getting data from\n[Outbreaks Near Me][outbreaksnearme].\n\n- [Installation](#installation)\n- [Python Versions](#python-versions)\n- [Usage](#usage)\n- [Contributing](#contributing)\n\n# Installation\n\n```bash\npip install pyoutbreaksnearme\n```\n\n# Python Versions\n\n`pyoutbreaksnearme` is currently supported on:\n\n- Python 3.10\n- Python 3.11\n- Python 3.12\n\n# Usage\n\n```python\nimport asyncio\n\nfrom aiohttp import ClientSession\n\nfrom pyoutbreaksnearme import Client\n\n\nasync def main() -> None:\n    \"\"\"Create the aiohttp session and run the example.\"\"\"\n    client = await Client()\n\n    # Get user-reported data for the location closest to a latitude/longitude:\n    nearest_user_data = await client.user_data.async_get_nearest_by_coordinates(\n        40.7152, -73.9877\n    )\n\n    # Get totals for user-reported data:\n    user_totals_data = await client.user_data.async_get_totals()\n\n    # Get CDC data for the location closest to a latitude/longitude:\n    nearest_user_data = await client.cdc_data.async_get_nearest_by_coordinates(\n        40.7152, -73.9877\n    )\n\n\nasyncio.run(main())\n```\n\nBy default, the library creates a new connection to Outbreaks Near Me with each\ncoroutine. If you are calling a large number of coroutines (or merely want to squeeze\nout every second of runtime savings possible), an [`aiohttp`][aiohttp] `ClientSession` can\nbe used for connection pooling:\n\n```python\nimport asyncio\n\nfrom aiohttp import ClientSession\n\nfrom pyoutbreaksnearme import Client\n\n\nasync def main() -> None:\n    \"\"\"Create the aiohttp session and run the example.\"\"\"\n    async with ClientSession() as session:\n        # Create a Notion API client:\n        client = await Client(session=session)\n\n        # Get to work...\n\n\nasyncio.run(main())\n```\n\n# Contributing\n\nThanks to all of [our contributors][contributors] so far!\n\n1. [Check for open features/bugs][issues] or [initiate a discussion on one][new-issue].\n2. [Fork the repository][fork].\n3. (_optional, but highly recommended_) Create a virtual environment: `python3 -m venv .venv`\n4. (_optional, but highly recommended_) Enter the virtual environment: `source ./.venv/bin/activate`\n5. Install the dev environment: `script/setup`\n6. Code your new feature or bug fix on a new branch.\n7. Write tests that cover your new functionality.\n8. Run tests and ensure 100% code coverage: `poetry run pytest --cov pyoutbreaksnearme tests`\n9. Update `README.md` with any new documentation.\n10. Submit a pull request!\n\n[aiohttp]: https://github.com/aio-libs/aiohttp\n[ci-badge]: https://github.com/bachya/pyoutbreaksnearme/workflows/CI/badge.svg\n[ci]: https://github.com/bachya/pyoutbreaksnearme/actions\n[codecov-badge]: https://codecov.io/gh/bachya/pyoutbreaksnearme/branch/dev/graph/badge.svg\n[codecov]: https://codecov.io/gh/bachya/pyoutbreaksnearme\n[contributors]: https://github.com/bachya/pyoutbreaksnearme/graphs/contributors\n[fork]: https://github.com/bachya/pyoutbreaksnearme/fork\n[issues]: https://github.com/bachya/pyoutbreaksnearme/issues\n[license-badge]: https://img.shields.io/pypi/l/pyoutbreaksnearme.svg\n[license]: https://github.com/bachya/pyoutbreaksnearme/blob/main/LICENSE\n[maintainability-badge]: https://api.codeclimate.com/v1/badges/4707fac476249d515511/maintainability\n[maintainability]: https://codeclimate.com/github/bachya/pyoutbreaksnearme/maintainability\n[new-issue]: https://github.com/bachya/pyoutbreaksnearme/issues/new\n[new-issue]: https://github.com/bachya/pyoutbreaksnearme/issues/new\n[outbreaksnearme]: https://outbreaksnearme.org\n[pypi-badge]: https://img.shields.io/pypi/v/pyoutbreaksnearme.svg\n[pypi]: https://pypi.python.org/pypi/pyoutbreaksnearme\n[version-badge]: https://img.shields.io/pypi/pyversions/pyoutbreaksnearme.svg\n[version]: https://pypi.python.org/pypi/pyoutbreaksnearme\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "A Python3 API for Outbreaks Near Me",
    "version": "2023.12.0",
    "project_urls": {
        "Bug Tracker": "https://github.com/bachya/pyoutbreaksnearme/issues",
        "Changelog": "https://github.com/bachya/pyoutbreaksnearme/releases",
        "Homepage": "https://github.com/bachya/pyoutbreaksnearme",
        "Repository": "https://github.com/bachya/pyoutbreaksnearme"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "fbf813ac13b75faebd9ada521f569d7a41149f55a745ae520c1a8fcdae237b5e",
                "md5": "c1be5bab1797a33bda02d5fab8ad2503",
                "sha256": "53cbcda994cd7afebae46a615f800d0d7e0d33291b135b7e5d24e222e03e0fbb"
            },
            "downloads": -1,
            "filename": "pyoutbreaksnearme-2023.12.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "c1be5bab1797a33bda02d5fab8ad2503",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.10,<4.0",
            "size": 8333,
            "upload_time": "2023-12-18T02:21:30",
            "upload_time_iso_8601": "2023-12-18T02:21:30.592154Z",
            "url": "https://files.pythonhosted.org/packages/fb/f8/13ac13b75faebd9ada521f569d7a41149f55a745ae520c1a8fcdae237b5e/pyoutbreaksnearme-2023.12.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "832b4220f94d8d6f6d81822e5a5caf58399e807ca415e8b4c7f93979cca30521",
                "md5": "1209b59c7c3f399b0378046e6af74608",
                "sha256": "0b5b7126b6057e913d145599aed79ff0d0eead8c9477c91924c25795da0d72db"
            },
            "downloads": -1,
            "filename": "pyoutbreaksnearme-2023.12.0.tar.gz",
            "has_sig": false,
            "md5_digest": "1209b59c7c3f399b0378046e6af74608",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.10,<4.0",
            "size": 7818,
            "upload_time": "2023-12-18T02:21:32",
            "upload_time_iso_8601": "2023-12-18T02:21:32.175480Z",
            "url": "https://files.pythonhosted.org/packages/83/2b/4220f94d8d6f6d81822e5a5caf58399e807ca415e8b4c7f93979cca30521/pyoutbreaksnearme-2023.12.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-12-18 02:21:32",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "bachya",
    "github_project": "pyoutbreaksnearme",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "pyoutbreaksnearme"
}
        
Elapsed time: 0.15094s