This project has been archived by its maintainers, and is no longer receiving any updates.
UNMAINTAINED
PLEASE NOTE: this library is not actively maintained and receives only minimal updates necessary. Most of it is no longer in active use at Ro.
fdadb
A Django wrapper for fda.gov National Drug Code (NDC) database. fdadb stores each row under one name MedicationName object instead of having multiple drugs with the same name next to each other, for example: In the NDC database there are around 21 Viagras (with different strengths) so in such case we save the MedicationName: Viagra and under this name we store all the 21 instances. This allows for better user experience when searching through the list of drugs.
Setting Up
pip install fdadb
Add fdadb to your INSTALLED_APPS
./manage.py migrate fdadb
./manage.py fetch_ndc_database - might take 15-30 minutes (the command will fetch all items from FDA database and save it in your project)
API:
All APIs are searchable with ?q=term query param.
medications/
Returns list of MedicationName objects (pass ?q=termtosearch to filter the results), this API supports ElasticSearch for fast querying. Pagination does not work yet when ElasticSearch is enabled (in most cases this does not cause any issues, as this API is generally used for drug autocomplete). You can change the autocomplete limit by setting FDADB_AUTOCOMPLETE_LIMIT in your Django configuration (default: 10).
The ElasticSearch uses ngram for the query parameter.
medications/(?P<medication_name>[w-]+)/strengths
Returns list of medication strengths
medications/(?P<medication_name>[w-]+)/strengths/(?P<strength_id>[d-]+)/ndcs
Returns list of Medication NDCs
ElasticSearch
To enable support of ElasticSearch in autocomplete, set:
ELASTICSEARCH_URL in project configuration
Run ./manage.py fdadb_es_index after fetching the NDC database (use --drop_indexes in case you want to cleanup the medications index)
Manage.py commands
./manage.py fdadb_es_index - indexes the products into ElasticSearch
./manage.py fetch_ndc_database - fetches products data from NDS DB and saves in the database
Support
Django 1.11, 2.1, 2.2
Python 3.4-3.6
Metadata
Release files for fdadb 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| fdadb-0.2.0.tar.gz | 13.4 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| fdadb-0.2.0-py2.py3-none-any.whl | Python 2, Python 3 | none | any | Details |
Total release size: 26.1 kB
Release files / fdadb-0.2.0.tar.gz
| Download URL | fdadb-0.2.0.tar.gz |
|---|---|
| Size | 13.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
27d2a67adc2441f50cff9317d4c6903101bbbcda3dddfe18dec9368213f120eb
|
|
BLAKE2b-256 checksum How to use checksums |
49f92839d16e30c04ff4d15ecf598aba4a58a81e236b6360936d3c2d7b32589a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.6
|
Release files / fdadb-0.2.0-py2.py3-none-any.whl
| Download URL | fdadb-0.2.0-py2.py3-none-any.whl |
|---|---|
| Size | 12.7 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
777d29d37bdc6161b2f3c82f2062c7169fbcea2124953671fce1fe30c1d43179
|
|
BLAKE2b-256 checksum How to use checksums |
f847a14a97975262da7594220cb3ec1687ce714e3235442be322903064bf1cce
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.6
|
Security for fdadb 0.2.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.