Registry / data / pysradb

pysradb

JSON →
library2.5.1pypypi✓ verified 82d ago

pysradb is a Python tool for querying and downloading metadata and data from NCBI SRA (Sequence Read Archive), ENA (European Nucleotide Archive), and GEO (Gene Expression Omnibus). It provides CLI and Python interfaces to search experiments, samples, runs, and download FASTQ/SRA files. Current version 2.5.1 (released 2025, active development).

pip install pysradb
INSTALL
IMPORT
SIG · PYSRADB
P
pysradb
datapythonv2.5.1
Install
9.2s avg
Import
Disk
182MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v2.5.1 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.000s · 183.8MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 9.2s · import 0.000s · 176MB
182MB installed
● package 182MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

SRAweb
from pysradb import SRAweb
from pysradb import SRA database
SRAdb
from pysradb import SRAdb
GEOdb
from pysradb import GEOdb

Initialize the SRA database and search for studies related to a gene/term.

from pysradb import SRA database db = SRA database() df = db.search('SMAD4', n=5) print(df[['study_accession', 'experiment_title', 'sample_accession']].head())
pysradb --version
Debug
Known issues
breakingIn v2.0.0, the API was completely rewritten. The old SRA class and CLI commands are replaced. Scripts using pysradb <2.0.0 will break.
fix
Migrate to new API: use 'from pysradb import SRA database' and new method signatures.
affects: <2.0.0
gotchaThe '.search()' method may return empty results if the query is too specific or server timeout. Always check if the returned DataFrame is empty.
fix
Wrap search in a try-except or check df.empty after calling search.
affects: all
deprecatedThe 'sradb' command-line entry point is deprecated in favor of 'pysradb' CLI. Using 'sradb' will emit a warning and may be removed in future.
fix
Use 'pysradb' instead of 'sradb' for CLI commands.
affects: >=2.3.0
Upgrade
Version history
2.5.1latest on PyPI · released Oct 20, 2025
Audit
Dependencies
pandasrequiredData manipulation for metadata tables
requestsrequiredHTTP requests to NCBI/ENA APIs
tqdmrequiredProgress bars for downloads
Agent activity
13 hits · last 30 days
node
12
Resources
pysradb — pip install pysradb · libregistry