Python toolkit for fetching GEO / SRA / ENA metadata into structured tables.
Project description
BioDownloader
A lightweight Python toolkit for programmatic retrieval of structured metadata from GEO, SRA, and ENA. The package provides a clean Python API and a command-line interface (biofetch) for downloading, parsing, and exporting metadata required for downstream RNA‑seq and NGS workflows.
Features
- Retrieve GEO Series metadata (GSE/GSM) directly via NCBI GEO API.
- Fetch SRA RunInfo tables using SRA's RunInfo interface.
- Query ENA run‑level annotations using ENA XML/TSV endpoints.
- Unified schema normalization for cross‑database consistency.
- Optional GEO–SRA merged metadata for integrated analyses.
- Command‑line client (
biofetch) for quick export to CSV/TSV. - Fully pure‑Python (no external tools required).
Installation
BioDownloader is available on PyPI:
pip install biodownloader
Verify installation:
python3 -c "import biodownloader; print(biodownloader.__version__)"
Command‑Line Usage (CLI: biofetch)
BioDownloader includes a CLI for rapid metadata extraction.
GEO
biofetch --source geo --id GSE181294 --limit 10 --out geo_metadata.csv
SRA (BioProject)
biofetch --source sra --id PRJNA730495 --limit 20 --out sra_runinfo.csv
ENA
biofetch --source ena --id SRR23080510 --limit 5 --out ena_meta.tsv
GEO–SRA Merge
biofetch --source merge --geo GSE181294 --sra PRJNA730495 --out merged.csv
Python API Usage
BioDownloader exposes simple, high‑level functions.
GEO Metadata
from biodownloader import fetch_geo_series
df = fetch_geo_series("GSE181294", limit=5)
print(df.head())
SRA RunInfo
from biodownloader import fetch_sra_bioproject
df = fetch_sra_bioproject("PRJNA730495", limit=10)
print(df[["Run", "SampleName"]].head())
ENA Run‑Level Metadata
from biodownloader import fetch_ena_accession
df = fetch_ena_accession("SRR23080510", limit=3)
print(df)
GEO–SRA Integrated Table
from biodownloader import fetch_and_merge_geo_sra
merged = fetch_and_merge_geo_sra(
geo_id="GSE181294",
sra_id="PRJNA730495",
geo_limit=None,
sra_limit=50,
how="inner",
)
print(merged.head())
Normalized Output Schema
GEO Output Columns
GSE,GSM,title,organism,source_name,characteristics
SRA Output Columns (subset)
Run,SampleName,BioProject,LibraryStrategy,Platform,Model,download_path,size_MB,avgLength,spots
ENA Output Columns
run_accession,description,accession
Merged GEO–SRA Columns
Includes all normalized columns from both data sources, joined on SampleName / GSM.
Project Structure
biodownloader/
├── geo.py # GEO metadata retrieval
├── sra.py # SRA RunInfo fetcher
├── ena.py # ENA metadata fetcher
├── integrate.py # GEO–SRA merging
├── cli.py # biofetch CLI
├── __init__.py # public API exports
Tests
Contains minimal integration tests (CSV comparison / schema validation):
tests/
├── test_geo.py
├── test_sra.py
├── test_ena.py
├── test_merge.py
Run tests:
pytest -q
Versioning
Follows semantic versioning (SemVer):
- MAJOR: breaking API changes
- MINOR: new features
- PATCH: bug fixes
License
MIT License.
Contact
For issues or feature requests, open a GitHub Issue.
Repository: https://github.com/KiarashBabaei/BioDownloader
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file biodownloader-0.2.4.tar.gz.
File metadata
- Download URL: biodownloader-0.2.4.tar.gz
- Upload date:
- Size: 9.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
be6516fac429cb13cfd9f22f9027c7860f1beeea31d1267c2a18b188284d0e9b
|
|
| MD5 |
37e6d49124d2a6f050a0451d455db0ef
|
|
| BLAKE2b-256 |
15347c9302d5b4443eee21d51f75d530e3b5ab1bbbe706d0ac1ec8ccd1dfc920
|
Provenance
The following attestation bundles were made for biodownloader-0.2.4.tar.gz:
Publisher:
publish.yml on KiarashBabaei/Biodownloader
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
biodownloader-0.2.4.tar.gz -
Subject digest:
be6516fac429cb13cfd9f22f9027c7860f1beeea31d1267c2a18b188284d0e9b - Sigstore transparency entry: 732659792
- Sigstore integration time:
-
Permalink:
KiarashBabaei/Biodownloader@393cc8d51055059bf04a7e8d46d7ea1a5bfb3980 -
Branch / Tag:
refs/tags/v0.2.4 - Owner: https://github.com/KiarashBabaei
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@393cc8d51055059bf04a7e8d46d7ea1a5bfb3980 -
Trigger Event:
push
-
Statement type:
File details
Details for the file biodownloader-0.2.4-py3-none-any.whl.
File metadata
- Download URL: biodownloader-0.2.4-py3-none-any.whl
- Upload date:
- Size: 10.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
973d9ab16b221ad0bcfc619a76a143204636427bace7c82d6264243a66301794
|
|
| MD5 |
7a40164c7661ef5888e3788e9e9bc32d
|
|
| BLAKE2b-256 |
72b88353442852ad2c3b1f2ad8576482d8a5f1bd3659be0b3abdbc367a67846f
|
Provenance
The following attestation bundles were made for biodownloader-0.2.4-py3-none-any.whl:
Publisher:
publish.yml on KiarashBabaei/Biodownloader
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
biodownloader-0.2.4-py3-none-any.whl -
Subject digest:
973d9ab16b221ad0bcfc619a76a143204636427bace7c82d6264243a66301794 - Sigstore transparency entry: 732659833
- Sigstore integration time:
-
Permalink:
KiarashBabaei/Biodownloader@393cc8d51055059bf04a7e8d46d7ea1a5bfb3980 -
Branch / Tag:
refs/tags/v0.2.4 - Owner: https://github.com/KiarashBabaei
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@393cc8d51055059bf04a7e8d46d7ea1a5bfb3980 -
Trigger Event:
push
-
Statement type: