Skip to main content

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

PyPI: https://pypi.org/project/biodownloader/

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

biodownloader-0.2.4.tar.gz (9.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

biodownloader-0.2.4-py3-none-any.whl (10.3 kB view details)

Uploaded Python 3

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

Hashes for biodownloader-0.2.4.tar.gz
Algorithm Hash digest
SHA256 be6516fac429cb13cfd9f22f9027c7860f1beeea31d1267c2a18b188284d0e9b
MD5 37e6d49124d2a6f050a0451d455db0ef
BLAKE2b-256 15347c9302d5b4443eee21d51f75d530e3b5ab1bbbe706d0ac1ec8ccd1dfc920

See more details on using hashes here.

Provenance

The following attestation bundles were made for biodownloader-0.2.4.tar.gz:

Publisher: publish.yml on KiarashBabaei/Biodownloader

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for biodownloader-0.2.4-py3-none-any.whl
Algorithm Hash digest
SHA256 973d9ab16b221ad0bcfc619a76a143204636427bace7c82d6264243a66301794
MD5 7a40164c7661ef5888e3788e9e9bc32d
BLAKE2b-256 72b88353442852ad2c3b1f2ad8576482d8a5f1bd3659be0b3abdbc367a67846f

See more details on using hashes here.

Provenance

The following attestation bundles were made for biodownloader-0.2.4-py3-none-any.whl:

Publisher: publish.yml on KiarashBabaei/Biodownloader

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page