This library interacts with the United States National Library of Medicine's Daily Med API.
- Install Python requirements
pip install -r ./requirements
Importing an instantiating the Daily Med object:
from daily_med import DailyMed
dm = DailyMed()
get_spls mirrors the /spls interface as documented here <https://dailymed.nlm.nih.gov/dailymed/webservices-help/v2/spls_api.cfm.
To get an iterator of all SPLs:
spl_metas = dm.get_spls()
You can also perform an SPL search using any of the standard query parameters:
simvastatin_metas = dm.get_spls(drug_name='Simvastatin')
Once you have a set_id for an SPL, you can get its document:
spl_document = dm.get_spl('0be2e371-1f05-48d7-8f2e-f2024f3305f3')
An SPL Document is basically just a dictionary representing the parsed XML document.
- SPLDocument is only Python 2 compatible. Generate a Python3 version and integrate an import switch for py2/3. Downfall is that this will add another 6mb of code to the repo & coverage will be inaccurate because not everything is testable at once.
- LasLabs: Icon.
- Dave Lasley <dave@laslabs.com>
This module is maintained by LasLabs Inc.