open_fda_drug_label.open_fda_drug_label

Functions

make_drugs(api_key, field_list, criteria_list[, ...])

OVERVIEW:

Module Contents

open_fda_drug_label.open_fda_drug_label.make_drugs(api_key, field_list: list, criteria_list: list, exact: bool = False, limit: int = 1)[source]
OVERVIEW:

Function designed to streamline new drug construction. Takes in user’s API key, list of desired search fields, list of specific criteria for each field, whether exact match is to be used, and limit of search results

Parameters:
  • field_list (list) – list of strings containing appropriate fields for drug search of openFDA

  • criteria_list (list) – list of strings containing specific search terms for inputted fields

  • exact (bool) – checking if exact match should be used or not

  • limit (int) – number of drugs that should be enabled in a drug search

RETURN VALUE:

drugs (list): list of drug(s) that were generated by this function

USAGE EXAMPLE:
>>> make_drugs(api_key, ["brand_name"],["Advil"],exact=True, limit=3)
>>> # above code builds list of 3 drugs named exactly "Advil"