{ "info": { "author": "Yubin Park", "author_email": "yubin.park@gmail.com", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: Apache Software License", "Operating System :: OS Independent", "Programming Language :: Python :: 3" ], "description": "# pharmpy \n\n`pharmpy` is an umbrella Python library for searching the FDA NDC directory, Established Pharmacologic Class (EPC), Anatomical Therapeutic Chemical (ATC) through RxNav, and some other APIs on RxNav.\n\n## Installing\n\nInstalling from the source:\n```\n$ git clone git@github.com:yubin-park/pharmpy.git\n$ cd pharmpy\n$ python setup.py develop\n```\n\nOr, simply using `pip`:\n```\n$ pip install pharmpy\n```\n\nA NOTE for the users who want to use RxNav functions such as ATC and Drug Interactions. For those, we strongly recommend using the [RxNav-in-a-Box](https://rxnav.nlm.nih.gov/RxNav-in-a-Box.html) rather than the RxNav REST APIs. \nThe RxNav-in-a-Box is a [Docker](https://www.docker.com/) conatiner image that installs on your local machine. \nTo use the image, please follow the set-up instructions, which are available inside the [downloadable zip file](https://mor.nlm.nih.gov/dnwl/auth/docker/rxnav-apis-docker.zip), and carefully read the [UMLS license agreement](https://uts.nlm.nih.gov/license.html).\nIf you decide to use the RxNAV REST APis, you should control the rate limit (20 calls per second) by yourself. \nThis `pharmpy` module does not control the rate limit by itself.\n\n## File Structure\n- `pharmpy/`: The package source code is located here.\n - `data/`: The raw data files downloaded from [the FDA website](https://www.fda.gov/drugs/drug-approvals-and-databases/national-drug-code-directory). If you are using the RxNav functions and data, the caches of the query results will be stored in this folder as well.\n - `epc.py`: Established Pharmacologic Class (EPC) engine from the FDA website\n - `rxcui.py`: A RxNorm Concept Unique Identifier (RxCUI) module that maps from NDC to RxCUI. [Dependancy: RxNav]\n - `atc.py`: A mapping from NDCs to Level-4 Anatomical Therapeutic Chemical (ATC). [Dependency: RxNav]\n - `druginter.py`: A mapping from a list of NDCs to a potential drug-drug interactions. [Dependency: RxNav]\n - `utils.py`: A module for readings data files\n- `tests/`: test scripts to check the validity of the outputs.\n- `LICENSE.txt`: Apache 2.0.\n- `README.md`: This README file.\n- `setup.py`: a set-up script.\n\n## Code Examples\n`pharmpy` is really simple to use. \nPlease see some examples below.\nNOTE that all functions used below have docstrings. \nIf you want to see the input parameter specifications,\nplease type `print(..__doc__)`.\n\n### Using EPC\n```python\n>>> from pharmpy.epc import EPCEngine\n>>> epe = EPCEngine()\n>>> res = epe.get_epc(\"50090347201\")\n>>> import json\n>>> print(json.dumps(res, indent=2))\n{\n \"ndc\": \"50090-3472\",\n \"name_proprietary\": \"JANUVIA\",\n \"name_generic\": \"sitagliptin\",\n \"substance_lst\": [\n \"SITAGLIPTIN PHOSPHATE\"\n ],\n \"pc_lst\": [\n \"Dipeptidyl Peptidase 4 Inhibitor [EPC]\",\n \"Dipeptidyl Peptidase 4 Inhibitors [MoA]\"\n ]\n}\n>>>\n```\n\n### Using RxCUI\n```python\n>>> from pharmpy.rxcui import RxCUIEngine\n>>> rce = RxCUIEngine()\n>>> res = rce.get_rxcui(\"50090347201\")\n>>> print(json.dumps(res, indent=2))\n\"665044\"\n>>>\n```\n\n### Using ATC\n```python\n>>> from pharmpy.atc import ATCEngine\n>>> ae = ATCEngine()\n>>> res = ae.get_atc(\"50090347201\")\n>>> print(json.dumps(res, indent=2))\n[\n {\n \"id\": \"A10BH\",\n \"name\": \"Dipeptidyl peptidase 4 (DPP-4) inhibitors\"\n }\n]\n>>>\n```\n\n### Using DrugInter\n```python\n>>> from pharmpy.druginter import DrugInterEngine\n>>> dre = DrugInterEngine()\n>>> res = dre.get_interactions_from_rxcui([\"88014\",\"8123\"])\n>>> print(json.dumps(res, indent=2))\n[\n {\n \"pair\": [\n \"8123\",\n \"88014\"\n ],\n \"desc\": [\n \"[ONCHigh] Triptans - monoamine oxidase (MAO) inhibitors\"\n ]\n }\n]\n>>>\n```\n\n### Warming-up Caches\n\nFor the RxNav functions, `pharmpy` keeps cache, so that you do not need to query again for the same results. \nFor most use cases, we recommend you warm up the cache before using any of the RxNav functions. \nThe warm-up process goes through a comprehensive list of NDCs, and store all results into a local drive. \nThe total process takes up about 6 hours, however, you would rarely need to query new results after warming up the cache.\n\n- RxCUI Cache Warm-up\n```python\n>> from pharmpy.rxcui import RxCUIEngine\n>> rce = RxCUIEngine()\n>> rce.run_cache() # this takes about 2-3 hours using RxNav-in-a-Box\n```\n- ATC Cache Warm-up\n```python\nfrom pharmpy.atc import ATCEngine\nae = ATCEngine()\nae.run_cache() # takes about 10-20 minutes using RxNav-in-a-Box\n```\n- DrugInter Cache Warm-up\n```python\nfrom pharmpy.druginter import DrugInterEngine\ndre = DrugInterEngine()\ndre.run_cache() # takes about 2 hours using RxNav-in-a-Box\n```\nThe caches are stored in a local drive indefinitely. \nThus, you just need to run these warm-up scripts periodically whenever you update the RxNav-in-a-Box monthly images.\n\nPlease refer to the test scripts under the `tests/` folder if you want to see other example use cases.\n\n## License\nApache 2.0\n\n## Authors\nYubin Park, PhD\n\n## References\n- https://open.fda.gov/data/ndc/\n- https://www.accessdata.fda.gov/cder/ndctext.zip\n- https://www.fda.gov/drugs/drug-approvals-and-databases/ndc-product-file-definitions\n- https://rxnav.nlm.nih.gov/RxNav-in-a-Box.html\n- https://mor.nlm.nih.gov/pubs/pdf/2018-amia-lp-poster.pdf\n- https://rxnav.nlm.nih.gov/APIsOverview.html\n\n\n\n\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/yubin-park/pharmpy", "keywords": "", "license": "Apaceh 2.0", "maintainer": "", "maintainer_email": "", "name": "pharmpy", "package_url": "https://pypi.org/project/pharmpy/", "platform": "", "project_url": "https://pypi.org/project/pharmpy/", "project_urls": { "Homepage": "https://github.com/yubin-park/pharmpy" }, "release_url": "https://pypi.org/project/pharmpy/0.0.2/", "requires_dist": null, "requires_python": "", "summary": "pharmpy is an umbrella library for searching the FDA NDC directory, Established Pharmacologic Class (EPC), Anatomical Therapeutic Chemical (ATC) through RxNav, and some other APIs on RxNav.", "version": "0.0.2" }, "last_serial": 5640388, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "2c100c784a0b1d83b8269ecc49b32516", "sha256": "ba3085987fb23020324415c671d9c4cfb3f2dbc153ed62b2a8d0162435229fd7" }, "downloads": -1, "filename": "pharmpy-0.0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "2c100c784a0b1d83b8269ecc49b32516", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 13246650, "upload_time": "2019-05-13T14:21:30", "url": "https://files.pythonhosted.org/packages/f4/95/c49594229187f56fe6782d38ff176e961794fb5d8468b971bc0b9c341206/pharmpy-0.0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "94b64f71e50daa879b3a0a7c739e2d95", "sha256": "d6c6700dd9f845db16e75a454ecfb15173289e719582c1c048b6d454e7ce459a" }, "downloads": -1, "filename": "pharmpy-0.0.1.tar.gz", "has_sig": false, "md5_digest": "94b64f71e50daa879b3a0a7c739e2d95", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7163, "upload_time": "2019-05-13T14:21:33", "url": "https://files.pythonhosted.org/packages/2c/fc/47587042f644f041dbf5336b2ca50872d0328dccfe1d35996e6f9ca0d2b1/pharmpy-0.0.1.tar.gz" } ], "0.0.2": [ { "comment_text": "", "digests": { "md5": "67b64b363342bc53116616fe9b7c7218", "sha256": "853d4602c5b4bb48298ca75cd6c3c4f10f54e4de650e6d1c48e741dbfa3e4f43" }, "downloads": -1, "filename": "pharmpy-0.0.2-py3-none-any.whl", "has_sig": false, "md5_digest": "67b64b363342bc53116616fe9b7c7218", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 13246715, "upload_time": "2019-08-06T15:17:33", "url": "https://files.pythonhosted.org/packages/34/bf/e5108817326612e00171ede2f678f577a102788021040b8e60df3bf32c29/pharmpy-0.0.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "5b80a6b54d194fcc09455e092ec3b972", "sha256": "93b83a443d1a44dd9ffabffc44d7cc19186d005c8e1c856df6de78b2edc82cc0" }, "downloads": -1, "filename": "pharmpy-0.0.2.tar.gz", "has_sig": false, "md5_digest": "5b80a6b54d194fcc09455e092ec3b972", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7214, "upload_time": "2019-08-06T15:17:37", "url": "https://files.pythonhosted.org/packages/bb/1a/82a2e7560f154d1ae17fd6685d05a57eee8c7ec7c5b7b26b6625aea443f9/pharmpy-0.0.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "67b64b363342bc53116616fe9b7c7218", "sha256": "853d4602c5b4bb48298ca75cd6c3c4f10f54e4de650e6d1c48e741dbfa3e4f43" }, "downloads": -1, "filename": "pharmpy-0.0.2-py3-none-any.whl", "has_sig": false, "md5_digest": "67b64b363342bc53116616fe9b7c7218", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 13246715, "upload_time": "2019-08-06T15:17:33", "url": "https://files.pythonhosted.org/packages/34/bf/e5108817326612e00171ede2f678f577a102788021040b8e60df3bf32c29/pharmpy-0.0.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "5b80a6b54d194fcc09455e092ec3b972", "sha256": "93b83a443d1a44dd9ffabffc44d7cc19186d005c8e1c856df6de78b2edc82cc0" }, "downloads": -1, "filename": "pharmpy-0.0.2.tar.gz", "has_sig": false, "md5_digest": "5b80a6b54d194fcc09455e092ec3b972", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7214, "upload_time": "2019-08-06T15:17:37", "url": "https://files.pythonhosted.org/packages/bb/1a/82a2e7560f154d1ae17fd6685d05a57eee8c7ec7c5b7b26b6625aea443f9/pharmpy-0.0.2.tar.gz" } ] }