Skip to content

LasLabs/python-daily-med

Repository files navigation

License: AGPL-3 | Build Status | Coveralls Status | Codecov Status | Code Climate

Python Daily Med

This library interacts with the United States National Library of Medicine's Daily Med API.

Installation

  • Install Python requirements pip install -r ./requirements

Setup

Usage

Import and Instantiate

Importing an instantiating the Daily Med object:

from daily_med import DailyMed
dm = DailyMed()

Structured Product Label Metadata

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')

Structured Product Label Documents

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.

Known Issues / Road Map

  • 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.

Credits

Images

Contributors

Maintainer

LasLabs Inc.

This module is maintained by LasLabs Inc.

About

Python Library for interaction with US NLM Daily Med API

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages