drugbank-database-access
Parse local DrugBank XML for drug info, interactions, targets, and properties. Search by ID/name/CAS, extract DDIs with severity, map targets/enzymes/transporters, compute SMILES similarity. Primary via local XML; REST API rate-limited (3k/month dev). For live bioactivity use chembl-database-bioactivity; for compound properties use pubchem-compound-search.
npx skills add BioTender-max/awesome-bio-agent-skills --skill drugbank-database-access --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
What it does
Parses the local DrugBank XML to provide drug information lookups by DrugBank ID, name, or CAS, including descriptions, indications, mechanisms, and groups. It can extract drug-drug interactions with descriptions, classify severity, and check specific drug pairs. It retrieves targets, enzymes, transporters, and carriers with UniProt accessions, as well as pathway associations. It fetches chemical properties (SMILES, MW, logP) and supports cross-database mappings to PubChem, ChEMBL, KEGG, and UniProt. It can compute molecular similarity using RDKit fingerprints between two drugs. It also builds a cross-reference table for multiple drugs. It emphasizes using the local XML for batch work and mentions an optional REST API with a 3,000 requests/month limit for live data.
How it works
- Loads the DrugBank XML with Python's ElementTree, using the namespace http://www.drugbank.ca for all XPath queries.
- Builds an index mapping DrugBank IDs and lowercase names to their drug entries; supports a CAS-number fallback search.
- get_drug_info(drug_element) extracts fields: drugbank_id, name, type, description, indication, mechanism_of_action, cas_number, and groups.
- search_by_name(pattern) returns drugs whose names contain the pattern (case-insensitive).
- get_interactions(drug_element) collects all interactions with drug names and descriptions; classify_severity maps description text to major/moderate/minor based on keywords.
- check_interaction(drug1_elem, drug2_elem) finds a specific interaction between two drugs and annotates its severity.
- get_targets(drug_element, target_type) extracts targets, enzymes, transporters, or carriers, including UniProt IDs and gene names, plus actions.
- get_pathways(drug_element) collects SMPDB pathway associations with SMPDB IDs and names.
- get_property(drug_element, kind_name, section) retrieves a single property value (e.g., SMILES, Molecular Weight) from calculated or experimental sections; get_all_properties(drug_element) aggregates all such properties.
- drug_similarity(drug1_elem, drug2_elem, radius, nbits) computes Tanimoto similarity using Morgan fingerprints from RDKit if SMILES are available.
- get_external_ids(drug_element) extracts cross-references like PubChem, ChEMBL, KEGG, and UniProt IDs.
- build_crossref_table(names) constructs a dataframe listing drug name, DrugBank ID, PubChem, ChEMBL, and KEGG identifiers for a set of names.
When to use it
- When looking up drug information by DrugBank ID, name, or CAS number.
- When checking drug-drug interactions and their severity classifications for polypharmacy safety.
- When extracting drug targets, enzymes, transporters, and carriers with UniProt accessions.
- When retrieving chemical properties (SMILES, InChI, MW) for cheminformatics tasks.
- When mapping DrugBank entries to PubChem, ChEMBL, UniProt, KEGG.
- When building drug similarity matrices from molecular fingerprints.
- For live bioactivity data or compound property lookups without downloading a database, use chembl-database-bioactivity or pubchem-compound-search respectively.
What it can touch
- Uses local XML file drugbank_all_full_database.xml
- Requires Python packages: lxml, rdkit (rdkit-pypi), pandas
- Optional: REST API access (not the primary data path) with a limit of 3,000 requests per month for developers
- External identifiers include PubChem, ChEMBL, KEGG, UniProt
Caveats
- License is NOASSERTION; XML namespace handling is mandatory for XPath queries to work correctly.
- Prerequisites require DrugBank account and XML download; performance depends on XML size and parsing approach (iterparse recommended for memory-constrained environments).
- Methods rely on textual descriptions to classify interaction severity, which may be approximate depending on input content.
- The description notes a primary local XML workflow and an optional REST API with rate limits; it does not guarantee live data accuracy beyond those constraints.
# DrugBank Database — Local XML Access ## Overview Query the DrugBank comprehensive drug database (14,000+ drug entries, 5,000+ protein targets, 17,000+ drug interactions) by parsing the locally downloaded XML file with Python's ElementTree. Covers drug lookups, interaction checking, target/pathway extraction, chemical property analysis, and cross-database identifier mapping. ## When to Use - Looking up drug information (description, indication, mechanism, pharmacology) by DrugBank ID, name, or CAS number - Checking drug-drug interactions and severity classifications for polypharmacy safety - Extracting drug targets, enzymes, transporters, and carriers with UniProt accessions - Retrieving chemical properties (SMILES, InChI, molecular weight) for cheminformatics analysis - Mapping DrugBank entries to external databases (PubChem, ChEMBL, UniProt, KEGG) - Building drug similarity matrices from molecular fingerprints - For live bioactivity data (IC50, Ki, EC50) use `chembl-database-bioactivity` instead - For compound property lookups without downloading a database use `pubchem-compound-search` instead ## Prerequisites - **DrugBank account**: Register at https://go.drugbank.com/ (free a
- Overview
- When to Use
- Prerequisites
- Quick Start
- Core API
- 1. Data Access and Setup
- 2. Drug Information Queries
- 3. Drug-Drug Interactions
- 4. Drug Targets and Pathways
- 5. Chemical Properties and Similarity
- 6. Cross-Database Integration
- Key Concepts
- XML Namespace Handling
- Drug Entry Structure
pip install lxml pandas pip install rdkit-pypi # chemical similarity pip install drugbank-downloader # programmatic XML download
What does the drugbank-database-access skill do?
Parse local DrugBank XML for drug info, interactions, targets, and properties. Search by ID/name/CAS, extract DDIs with severity, map targets/enzymes/transporters, compute SMILES similarity. Primary via local XML; REST API rate-limited (3k/month dev). For live bioactivity use chembl-database-bioactivity; for compound properties use pubchem-compound-search.
How do I install it?
Run `npx skills add BioTender-max/awesome-bio-agent-skills --skill drugbank-database-access --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.
Where does this skill come from?
From BioTender-max/awesome-bio-agent-skills, a repository with 135 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.
Is a popular skill a good skill?
Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.
