refua-data
refua-data is the Refua data layer for drug discovery. It provides a curated dataset catalog, intelligent local caching, and parquet materialization optimized for downstream modeling and campaign workflows.
What it provides
- A built-in catalog of useful drug-discovery datasets.
- Dataset-aware download pipeline with cache reuse and metadata tracking.
- Pluggable cache backend architecture (filesystem cache by default).
- API dataset ingestion for paginated JSON endpoints (for example ChEMBL and UniProt).
- HTTP conditional refresh support (
ETag/Last-Modified) when enabled. - Support for partitioned parquet bundle downloads (for example Open Targets releases).
- Native Excel (
.xlsx) ingestion for datasets such as GDSC fitted dose-response releases. - Incremental parquet materialization (chunked processing + partitioned parquet parts).
- CLI for listing, fetching, and materializing datasets.
- Query interface for filtered row access from materialized parquet datasets.
- Source health checks via
validate-sourcesfor CI and environment diagnostics. - Rich dataset metadata snapshots (description + usage notes) persisted in cache metadata.
Included datasets
The default catalog includes local-file/HTTP datasets plus API presets useful in drug discovery, including ZINC, BindingDB, Open Targets, CancerRxGene/GDSC, ChEMBL, UniProt, openFDA, and the Human Protein Atlas.
zinc15_250k(ZINC)zinc15_tranche_druglike_instock(ZINC tranche)zinc15_tranche_druglike_agent(ZINC tranche)zinc15_tranche_druglike_wait_ok(ZINC tranche)zinc15_tranche_druglike_boutique(ZINC tranche)zinc15_tranche_druglike_annotated(ZINC tranche)tox21bbbpbaceclintoxsiderhivmuvesolfreesolvlipophilicitypcbabindingdb_articles_affinityopenfda_drug_event_seriousproteinatlas_human_proteomeopentargets_target_prioritisationgdsc2_fitted_dose_responsechembl_activity_ki_humanchembl_activity_ic50_humanchembl_activity_kd_humanchembl_activity_ec50_humanchembl_activity_ac50_humanchembl_assays_binding_humanchembl_assays_functional_humanchembl_assays_adme_humanchembl_targets_human_single_proteinchembl_targets_human_protein_complexchembl_molecules_phase3pluschembl_molecules_phase4chembl_molecules_black_box_warningchembl_mechanism_phase2pluschembl_drug_indications_phase2pluschembl_drug_indications_phase3plusuniprot_human_revieweduniprot_human_receptorsuniprot_human_membraneuniprot_human_nucleusuniprot_human_kinasesuniprot_human_gpcruniprot_human_ion_channelsuniprot_human_transportersuniprot_human_secreteduniprot_human_transcription_factorsuniprot_human_enzymes
Most of these are distributed through MoleculeNet/DeepChem mirrors and retain upstream licensing terms. BindingDB is included as a versioned ZIP-backed TSV snapshot for literature-derived affinity modeling. Open Targets is included as a versioned parquet-part bundle for target prioritisation workflows. CancerRxGene GDSC is included as a versioned Excel-backed dose-response release for cell-line pharmacology modeling. ChEMBL, UniProt, and openFDA presets are fetched through their public REST APIs and cached locally as JSONL. ZINC tranche presets aggregate multiple tranche files per dataset (drug-like MW B-K and logP A-K bins, reactivity A/B/C/E) into one cached tabular source during fetch.
Install
cd refua-data
pip install -e .
CLI quickstart
List datasets:
refua-data list
Validate all dataset sources:
refua-data validate-sources
Validate a subset and fail CI on probe failures:
refua-data validate-sources chembl_activity_ki_human uniprot_human_kinases --fail-on-error
JSON output for automation:
refua-data validate-sources --json --fail-on-error
For datasets with multiple mirrors, source validation succeeds when at least one configured source is reachable. Failed fallback attempts are included in the result details.
Fetch raw data with cache:
refua-data fetch zinc15_250k
Fetch API-based presets:
refua-data fetch chembl_activity_ki_human
refua-data fetch uniprot_human_kinases
Materialize parquet:
refua-data materialize zinc15_250k
Query materialized parquet rows:
refua-data query zinc15_250k --columns smiles,logP --filters '{"logP":{"lt":2.5}}' --limit 50
Refresh against remote metadata:
refua-data fetch zinc15_250k --refresh
For API datasets, --refresh re-runs the API query (with conditional headers on first page when available).
Cache layout
By default, cache root is:
~/.cache/refua-data
Override with:
REFUA_DATA_HOME=/custom/path
Layout:
raw/<dataset>/<version>/...downloaded source files_meta/raw/<dataset>/<version>/...jsonraw metadata (etag,sha256, API request signature, rows/pages, dataset description/usage metadata)parquet/<dataset>/<version>/part-*.parquetmaterialized parquet parts_meta/parquet/<dataset>/<version>/manifest.jsonparquet manifest metadata with dataset snapshot
Python API
from refua_data import DatasetManager
manager = DatasetManager()
manager.fetch("zinc15_250k")
manager.fetch("chembl_activity_ki_human")
result = manager.materialize("zinc15_250k")
print(result.parquet_dir)
DataCache is the default cache backend. You can pass a custom backend object that implements
the same interface (ensure, raw_file, raw_meta, parquet_dir, parquet_manifest,
read_json, write_json) to make storage pluggable.
Licensing notes
refua-datapackage code is MIT licensed.- Dataset content licenses are dataset-specific and controlled by upstream providers.
- Always verify dataset licensing and allowed use before redistribution or commercial deployment.
Metadata
Release files for refua-data 0.7.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| refua_data-0.7.2.tar.gz | 40.0 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| refua_data-0.7.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 75.0 kB
Release files / refua_data-0.7.2.tar.gz
| Download URL | refua_data-0.7.2.tar.gz |
|---|---|
| Size | 40.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5b3c6c63850894c3aec82b37216d83550c52776a4d05ee285da5372434af2833
|
|
BLAKE2b-256 checksum How to use checksums |
1c6af1a8c35edbca031f2d80d8f19ccb1a76233b62e2cc52732c88f2ca3719ba
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.3.4 CPython/3.14.4 Darwin/25.4.0
|
Release files / refua_data-0.7.2-py3-none-any.whl
| Download URL | refua_data-0.7.2-py3-none-any.whl |
|---|---|
| Size | 35.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
1801a9f0aa11700609e1db0b5ebc27c5df82ce1e20efb2cabab6ca2aef279f53
|
|
BLAKE2b-256 checksum How to use checksums |
bc2b4241ef7c37ff956bf2afc870425cc3dd660e682f394d41c291ee320db4d6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.3.4 CPython/3.14.4 Darwin/25.4.0
|
Security for refua-data 0.7.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.