pyiqvia


Namepyiqvia JSON
Version 2023.12.0 PyPI version JSON
download
home_pagehttps://github.com/bachya/pyiqvia
SummaryA clean, async-focused Python3 API for IQVIA data
upload_time2023-12-18 02:26:17
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.
            # 🌻 pyiqvia: A clean, async-focused Python3 API for IQVIA™

[![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>

`pyiqvia` is an async-focused Python3 library for allergen, asthma, and disease data from
the [IQVIAâ„¢][iqvia] family of websites (such as [Pollen.com][pollen],
[FluStar][flustar], and more).

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

# Python Versions

`pyiqvia` is currently supported on:

- Python 3.10
- Python 3.11
- Python 3.12

# Installation

```bash
pip install pyiqvia
```

# Usage

```python
import asyncio

from aiohttp import ClientSession

from pyiqvia import Client


async def main() -> None:
    """Run!"""
    # Note that ZIP codes must be provided as strings:
    client = Client("80012")

    # Get current allergen information:
    await client.allergens.current()

    # Get more information on the current allergen outlook:
    await client.allergens.outlook()

    # Get extended forecast allergen information:
    await client.allergens.extended()

    # Get historic allergen information:
    await client.allergens.historic()

    # Get current asthma information:
    await client.asthma.current()

    # Get extended forecast asthma information:
    await client.asthma.extended()

    # Get historic asthma information:
    await client.asthma.historic()

    # Get current cold and flu information:
    await client.disease.current()

    # Get extended forecast cold and flu information:
    await client.disease.extended()

    # Get historic cold and flu information:
    await client.disease.historic()


asyncio.run(main())
```

## Retries

By default, `pyiqvia` will retry appropriate errors 4 times (with an exponentially
increasing delay in-between). This logic can be changed by passing a different value for
`request_retries` to the `Client` constructor:

```python
import asyncio

from pyiqvia import Client


async def main():
    client = Client("80012", request_retries=5)

    # ...


asyncio.run(main())
```

## Connection Pooling

By default, the library creates a new connection to IQVIA 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 pyiqvia import Client


async def main() -> None:
    """Run!"""
    async with ClientSession() as session:
        client = Client("80012", session=session)

        # ...


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 pyiqvia 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/pyiqvia/workflows/CI/badge.svg
[ci]: https://github.com/bachya/pyiqvia/actions
[codecov-badge]: https://codecov.io/gh/bachya/pyiqvia/branch/dev/graph/badge.svg
[codecov]: https://codecov.io/gh/bachya/pyiqvia
[contributors]: https://github.com/bachya/pyiqvia/graphs/contributors
[flustar]: https://flustar.com
[fork]: https://github.com/bachya/pyiqvia/fork
[iqvia]: https://www.iqvia.com
[issues]: https://github.com/bachya/pyiqvia/issues
[license-badge]: https://img.shields.io/pypi/l/pyiqvia.svg
[license]: https://github.com/bachya/pyiqvia/blob/main/LICENSE
[maintainability-badge]: https://api.codeclimate.com/v1/badges/3bf37f9cabf73b5d991e/maintainability
[maintainability]: https://codeclimate.com/github/bachya/pyiqvia/maintainability
[new-issue]: https://github.com/bachya/pyiqvia/issues/new
[new-issue]: https://github.com/bachya/pyiqvia/issues/new
[pollen]: https://pollen.com
[pypi-badge]: https://img.shields.io/pypi/v/pyiqvia.svg
[pypi]: https://pypi.python.org/pypi/pyiqvia
[version-badge]: https://img.shields.io/pypi/pyversions/pyiqvia.svg
[version]: https://pypi.python.org/pypi/pyiqvia

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/bachya/pyiqvia",
    "name": "pyiqvia",
    "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/8f/db/77b6bf7d0cf132d2799d9f8e5eadf1b54553e8531254463fdb8e978344e5/pyiqvia-2023.12.0.tar.gz",
    "platform": null,
    "description": "# \ud83c\udf3b pyiqvia: A clean, async-focused Python3 API for IQVIA\u2122\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`pyiqvia` is an async-focused Python3 library for allergen, asthma, and disease data from\nthe [IQVIA\u2122][iqvia] family of websites (such as [Pollen.com][pollen],\n[FluStar][flustar], and more).\n\n- [Python Versions](#python-versions)\n- [Installation](#installation)\n- [Usage](#usage)\n- [Contributing](#contributing)\n\n# Python Versions\n\n`pyiqvia` is currently supported on:\n\n- Python 3.10\n- Python 3.11\n- Python 3.12\n\n# Installation\n\n```bash\npip install pyiqvia\n```\n\n# Usage\n\n```python\nimport asyncio\n\nfrom aiohttp import ClientSession\n\nfrom pyiqvia import Client\n\n\nasync def main() -> None:\n    \"\"\"Run!\"\"\"\n    # Note that ZIP codes must be provided as strings:\n    client = Client(\"80012\")\n\n    # Get current allergen information:\n    await client.allergens.current()\n\n    # Get more information on the current allergen outlook:\n    await client.allergens.outlook()\n\n    # Get extended forecast allergen information:\n    await client.allergens.extended()\n\n    # Get historic allergen information:\n    await client.allergens.historic()\n\n    # Get current asthma information:\n    await client.asthma.current()\n\n    # Get extended forecast asthma information:\n    await client.asthma.extended()\n\n    # Get historic asthma information:\n    await client.asthma.historic()\n\n    # Get current cold and flu information:\n    await client.disease.current()\n\n    # Get extended forecast cold and flu information:\n    await client.disease.extended()\n\n    # Get historic cold and flu information:\n    await client.disease.historic()\n\n\nasyncio.run(main())\n```\n\n## Retries\n\nBy default, `pyiqvia` will retry appropriate errors 4 times (with an exponentially\nincreasing delay in-between). This logic can be changed by passing a different value for\n`request_retries` to the `Client` constructor:\n\n```python\nimport asyncio\n\nfrom pyiqvia import Client\n\n\nasync def main():\n    client = Client(\"80012\", request_retries=5)\n\n    # ...\n\n\nasyncio.run(main())\n```\n\n## Connection Pooling\n\nBy default, the library creates a new connection to IQVIA with each coroutine. If you\nare calling a large number of coroutines (or merely want to squeeze out every second of\nruntime savings possible), an [`aiohttp`][aiohttp] `ClientSession` can be used for\nconnection pooling:\n\n```python\nimport asyncio\n\nfrom aiohttp import ClientSession\n\nfrom pyiqvia import Client\n\n\nasync def main() -> None:\n    \"\"\"Run!\"\"\"\n    async with ClientSession() as session:\n        client = Client(\"80012\", session=session)\n\n        # ...\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 pyiqvia 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/pyiqvia/workflows/CI/badge.svg\n[ci]: https://github.com/bachya/pyiqvia/actions\n[codecov-badge]: https://codecov.io/gh/bachya/pyiqvia/branch/dev/graph/badge.svg\n[codecov]: https://codecov.io/gh/bachya/pyiqvia\n[contributors]: https://github.com/bachya/pyiqvia/graphs/contributors\n[flustar]: https://flustar.com\n[fork]: https://github.com/bachya/pyiqvia/fork\n[iqvia]: https://www.iqvia.com\n[issues]: https://github.com/bachya/pyiqvia/issues\n[license-badge]: https://img.shields.io/pypi/l/pyiqvia.svg\n[license]: https://github.com/bachya/pyiqvia/blob/main/LICENSE\n[maintainability-badge]: https://api.codeclimate.com/v1/badges/3bf37f9cabf73b5d991e/maintainability\n[maintainability]: https://codeclimate.com/github/bachya/pyiqvia/maintainability\n[new-issue]: https://github.com/bachya/pyiqvia/issues/new\n[new-issue]: https://github.com/bachya/pyiqvia/issues/new\n[pollen]: https://pollen.com\n[pypi-badge]: https://img.shields.io/pypi/v/pyiqvia.svg\n[pypi]: https://pypi.python.org/pypi/pyiqvia\n[version-badge]: https://img.shields.io/pypi/pyversions/pyiqvia.svg\n[version]: https://pypi.python.org/pypi/pyiqvia\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "A clean, async-focused Python3 API for IQVIA data",
    "version": "2023.12.0",
    "project_urls": {
        "Bug Tracker": "https://github.com/bachya/pyiqvia/issues",
        "Changelog": "https://github.com/bachya/pyiqvia/releases",
        "Homepage": "https://github.com/bachya/pyiqvia",
        "Repository": "https://github.com/bachya/pyiqvia"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "64ff2b1daf21bb51bd831712f3701a7e86454ba28a590d29d2d7bcd075947996",
                "md5": "8f9b6f7f85a55175b6ac113f83e1da94",
                "sha256": "301739eb95d4e6ef79d7d8d445e8097272726aea1d7ecb6a8e113830b62562ec"
            },
            "downloads": -1,
            "filename": "pyiqvia-2023.12.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "8f9b6f7f85a55175b6ac113f83e1da94",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.10,<4.0",
            "size": 7997,
            "upload_time": "2023-12-18T02:26:16",
            "upload_time_iso_8601": "2023-12-18T02:26:16.394875Z",
            "url": "https://files.pythonhosted.org/packages/64/ff/2b1daf21bb51bd831712f3701a7e86454ba28a590d29d2d7bcd075947996/pyiqvia-2023.12.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "8fdb77b6bf7d0cf132d2799d9f8e5eadf1b54553e8531254463fdb8e978344e5",
                "md5": "d7aa064a787a9759fed3cbe4a3d3f499",
                "sha256": "7486e11572f8764d43ce709cdf060338c8df756553793170cb0aa19ac0454f01"
            },
            "downloads": -1,
            "filename": "pyiqvia-2023.12.0.tar.gz",
            "has_sig": false,
            "md5_digest": "d7aa064a787a9759fed3cbe4a3d3f499",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.10,<4.0",
            "size": 8315,
            "upload_time": "2023-12-18T02:26:17",
            "upload_time_iso_8601": "2023-12-18T02:26:17.466280Z",
            "url": "https://files.pythonhosted.org/packages/8f/db/77b6bf7d0cf132d2799d9f8e5eadf1b54553e8531254463fdb8e978344e5/pyiqvia-2023.12.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-12-18 02:26:17",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "bachya",
    "github_project": "pyiqvia",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "pyiqvia"
}
        
Elapsed time: 0.16345s