{"id":24406,"library":"pysradb","title":"PySRAdb","description":"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).","status":"active","version":"2.5.1","language":"python","source_language":"en","source_url":"https://github.com/saketkc/pysradb","tags":["bioinformatics","sra","ena","geo","sequence-download","metadata"],"install":[{"cmd":"pip install pysradb","lang":"bash","label":"Latest stable"}],"dependencies":[{"reason":"Data manipulation for metadata tables","package":"pandas","optional":false},{"reason":"HTTP requests to NCBI/ENA APIs","package":"requests","optional":false},{"reason":"Progress bars for downloads","package":"tqdm","optional":false}],"imports":[{"note":"The main class is SRA database, not the package directly.","wrong":"import pysradb","symbol":"SRA database","correct":"from pysradb import SRA database"}],"quickstart":{"code":"from pysradb import SRA database\ndb = SRA database()\ndf = db.search('SMAD4', n=5)\nprint(df[['study_accession', 'experiment_title', 'sample_accession']].head())","lang":"python","description":"Initialize the SRA database and search for studies related to a gene/term."},"warnings":[{"fix":"Migrate to new API: use 'from pysradb import SRA database' and new method signatures.","message":"In 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.","severity":"breaking","affected_versions":"<2.0.0"},{"fix":"Wrap search in a try-except or check df.empty after calling search.","message":"The '.search()' method may return empty results if the query is too specific or server timeout. Always check if the returned DataFrame is empty.","severity":"gotcha","affected_versions":"all"},{"fix":"Use 'pysradb' instead of 'sradb' for CLI commands.","message":"The 'sradb' command-line entry point is deprecated in favor of 'pysradb' CLI. Using 'sradb' will emit a warning and may be removed in future.","severity":"deprecated","affected_versions":">=2.3.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Run: pip install pysradb","cause":"pysradb not installed or installed in a different environment.","error":"ModuleNotFoundError: No module named 'pysradb'"},{"fix":"Use: from pysradb import SRA database","cause":"Trying to use old import pattern from pysradb <2.0.0.","error":"AttributeError: module 'pysradb' has no attribute 'SRA'"},{"fix":"Add a delay between requests (e.g., time.sleep(1)) or reduce query frequency.","cause":"Excessive API calls to NCBI servers triggering rate limit.","error":"HTTPError: 429 Client Error: Too Many Requests"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}