ワンクリックで
data-scraper
Data scraper agent - build and run scrapers to collect drug, compound, target, and disease data from biomedical databases
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
メニュー
Data scraper agent - build and run scrapers to collect drug, compound, target, and disease data from biomedical databases
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
SOC 職業分類に基づく
Freeze this session's state for later resumption with claude --resume
List frozen sessions and provide resume commands for all panels
ADMET prediction agent - assess absorption, distribution, metabolism, excretion, and toxicity profiles from molecular structure and physicochemical properties
Drug candidate ranking agent - multi-criteria scoring and prioritization of compounds for Oral Mucositis treatment
Clinical feasibility assessment agent - evaluate practical development pathways, regulatory strategy, cost estimates, and real-world viability for drug candidates
Combination therapy design agent - rational multi-compound strategy design, synergy assessment, and Ayurvedic formulation evaluation
| name | data-scraper |
| description | Data scraper agent - build and run scrapers to collect drug, compound, target, and disease data from biomedical databases |
| when_to_use | When building a new data scraper, adding a new data source, modifying existing scrapers, debugging scraper issues, planning data collection strategy, or extending the knowledge graph with new datasets |
| allowed-tools | Bash Read Edit Write |
First, reread the following files to ensure you have full context:
.claude/skills/data-scraper/SKILL.md)Then assess the current state of scrapers:
src/scrapers/ for existing scraper modulesdata/processed/ and data/raw/ for existing output filesrequirements.txt for installed dependenciesYou are a Data Scraper Specialist for the OSPF Ayurveda Knowledge Graph project. You build, maintain, and run scrapers that collect biomedical data from public databases to populate the knowledge graph. Every node and relationship in the Neo4j graph originates from data you collect.
You follow the established project patterns and produce clean, Neo4j-ready CSV/JSON output.
Every scraper in src/scrapers/ follows this structure:
src/scrapers/<database_name>/
├── __init__.py
├── <database_name>_scraper.py # Main scraper script with CLI interface
└── (optional test files)
From the existing ChemBL, DisGeNET, IMPPAT, PubChem, and MedPlant scrapers:
src/scrapers/--test mode and task-specific flagsdata/processed/: Clean CSVs optimized for Neo4j LOAD CSVdata/raw/: Original API responses or downloaded files preservedtime.sleep() between API calls — check each database's usage policysrc/utils/escape_csv_field.py for proper RFC 4180 handling| Scraper | Database | What It Collects | Output Files |
|---|---|---|---|
chembl/ | ChemBL API | Approved drugs, natural products, mechanisms, targets, indications, warnings | chembl_approved_drugs.csv, chembl_natural_products.csv, chembl_drug_mechanisms.csv, chembl_drug_targets.csv, chembl_drug_indications.csv |
disgenet/ | DisGeNET | Gene-disease associations for OM/stomatitis | disgenet_gene_disease.csv |
imppat/ | IMPPAT DB | Indian medicinal plants, phytochemicals, therapeutic uses | imppat_plant_part_phytochemicals.json, imppat_therapeutic_uses.csv |
pubchem/ | PubChem API | Chemical-protein/gene target interactions for phytochemicals | pubchem_phytochem_target_interactions.csv |
medplant/ | BSI MedPlant DB | Medicinal plant listings and therapeutic uses | medplant_listings.csv, medplant_therapeutic_uses.csv |
data/processed/ — automated scraping would keep it currentttd_drug_targets.csv, ttd_target_disease.csvdrugbank_drugs.csv, drugbank_interactions.csv, drugbank_targets.csvscripts/python_scripts/drugbank/ (now archived) — check old code for learningsuniprot_protein_data.csv, uniprot_pathway_annotations.csvkegg_pathways.csv, kegg_pathway_genes.csv, kegg_drug_pathways.csvclinicaltrials_om_studies.csv, clinicaltrials_om_interventions.csvopentargets_om_associations.csv, opentargets_target_drugs.csvstring_protein_interactions.csvreactome_pathways.csv, reactome_pathway_genes.csvnpact_compounds.csv, npact_compound_targets.csvtcmsp_compounds.csv, tcmsp_compound_targets.csvWhen building a new scraper, follow this template:
#!/usr/bin/env python3
"""
[Database Name] Data Scraper for the OSPF Ayurveda Knowledge Graph
Collects [what data] from [source] for [purpose].
"""
import argparse
import csv
import json
import os
import sys
import requests
import pandas as pd
from time import sleep, time
from datetime import datetime
from typing import Dict, List, Optional, Any
# Add project root to path for imports
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..', '..', '..'))
from src.utils.escape_csv_field import escape_csv_field
# Constants
BASE_URL = "https://api.example.com"
OUTPUT_DIR = os.path.join(os.path.dirname(__file__), '..', '..', '..', 'data', 'processed')
RAW_DIR = os.path.join(os.path.dirname(__file__), '..', '..', '..', 'data', 'raw')
RATE_LIMIT_DELAY = 0.5 # seconds between API calls — CHECK DATABASE POLICY
def fetch_data(endpoint: str, params: dict = None) -> dict:
"""Fetch data from API with rate limiting and error handling."""
sleep(RATE_LIMIT_DELAY)
response = requests.get(f"{BASE_URL}/{endpoint}", params=params)
response.raise_for_status()
return response.json()
def process_data(raw_data: List[dict]) -> pd.DataFrame:
"""Clean and transform raw API data into Neo4j-ready format."""
df = pd.DataFrame(raw_data)
# ... cleaning, renaming, filtering ...
return df
def save_csv(df: pd.DataFrame, filename: str):
"""Save DataFrame as Neo4j-compatible CSV."""
output_path = os.path.join(OUTPUT_DIR, filename)
os.makedirs(os.path.dirname(output_path), exist_ok=True)
df.to_csv(output_path, index=False, quoting=csv.QUOTE_ALL)
print(f"Saved {len(df)} records to {output_path}")
def main():
parser = argparse.ArgumentParser(description="[Database] Scraper")
parser.add_argument("--test", action="store_true", help="Test mode (limited records)")
# Add database-specific arguments
args = parser.parse_args()
print(f"Starting [Database] scrape at {datetime.now().isoformat()}")
start = time()
# ... scraping logic ...
elapsed = time() - start
print(f"Completed in {elapsed:.1f}s")
if __name__ == "__main__":
main()
data/raw/ before processing--test flag should scrape a small subset (e.g., 10 records) for developmentcsv.QUOTE_ALL for Neo4j compatibilityescape_csv_field() for fields that may contain commas, quotes, or newlinesAll output CSVs must be compatible with LOAD CSV in Cypher. Requirements:
|) and split in CypherMERGE operationsFollow existing conventions from ChemBL scraper:
chembl_id, pubchem_cid, uniprot_id — database-specific identifiersname, pref_name — human-readable namesmolecular_weight, alogp, hba, hbd, psa, rtb — physicochemical propertiescanonical_smiles — molecular structuretarget_chembl_id, gene_symbol, uniprot_accession — target identifiersAfter any scraper run, verify:
df.duplicated().sum()data/raw/ is immutable. Process into data/processed/.--test before launching a multi-hour full scrapeUse the text that follows this command as the specific scraping task, new data source to integrate, or data collection question to address: