Scrape GEO dataset IDs from ExomiRHub and download datasets from NCBI GEO.
Project description
biomedical_scraper
A Python module to extract GEO dataset IDs from ExomiRHub and download the corresponding datasets from NCBI GEO.
The site is a Vue.js SPA with an ag-Grid table - Selenium is required.
Requirements
- Python 3.10+
- Google Chrome installed
Installation
From PyPI:
pip install bio_scraper
From source:
git clone https://github.com/your-username/biomedical_scraper.git
cd biomedical_scraper
pip install -e .
Usage
As a CLI tool
bio-scraper --save-metadata --start 0 --end 5
bio-scraper --start 0 --end 1
bio-scraper --no-headless --start 0 --end 1
| Flag | Default | Description |
|---|---|---|
--start |
0 |
Start index of GEO IDs to download |
--end |
5 |
End index (exclusive) |
--save-metadata |
off | Save all GEO IDs to geo_ids.csv |
--headless |
True |
Run Chrome headlessly |
As a Python module
Fetch all GEO IDs
from biomedical_scraper import BiomedicalScraper
with BiomedicalScraper(headless=True) as scraper:
geo_ids = scraper.get_geo_ids()
print(geo_ids)
Get a download link for a specific dataset
from biomedical_scraper import BiomedicalScraper
with BiomedicalScraper() as scraper:
url = scraper.get_download_link("GSE144777")
print(url)
Fetch IDs + download datasets
from biomedical_scraper import BiomedicalScraper
from biomedical_scraper.downloader import GEODownloader
from biomedical_scraper.utils import select
from biomedical_scraper.metadata import save_metadata
with BiomedicalScraper(headless=True) as scraper:
geo_ids = scraper.get_geo_ids()
save_metadata(geo_ids)
subset = select(geo_ids, start=0, end=5)
downloader = GEODownloader()
for geo_id in subset:
url = scraper.get_download_link(geo_id)
if url:
downloader.download_from_url(url, geo_id)
Save metadata only (no download)
from biomedical_scraper import BiomedicalScraper
from biomedical_scraper.metadata import save_metadata
with BiomedicalScraper() as scraper:
geo_ids = scraper.get_geo_ids()
save_metadata(geo_ids, path="my_geo_ids.csv")
Output
| File | Description |
|---|---|
geo_ids.csv |
All GEO IDs scraped from ExomiRHub |
data/raw/geo/<ID>.tar |
Downloaded dataset archives |
debug_screenshot.png |
Auto-saved on timeout (debugging only) |
debug_page.html |
Auto-saved on timeout (debugging only) |
Project structure
biomedical_scraper/
├── biomedical_scraper/
│ ├── scraper.py # Selenium scraper (get_geo_ids, get_download_link)
│ ├── downloader.py # Resumable file downloader
│ ├── cli.py # bio-scraper entry point
│ ├── config.py # URLs, timeouts, paths
│ ├── metadata.py # CSV export
│ └── utils.py # ID selection helpers
└── setup.py
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
bio_scraper-0.1.1.tar.gz
(7.0 kB
view details)
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 bio_scraper-0.1.1.tar.gz.
File metadata
- Download URL: bio_scraper-0.1.1.tar.gz
- Upload date:
- Size: 7.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f37f206d4eb1648786189ce860241603d903b12d2931757d9133de7860758f82
|
|
| MD5 |
ad5f832e3f234e87aeb62cf67d9b0a5a
|
|
| BLAKE2b-256 |
a21ffe3a7c401b3b87a60b1d3a74554f78e9bf2a037c6efb8ee933640caff8ec
|
File details
Details for the file bio_scraper-0.1.1-py3-none-any.whl.
File metadata
- Download URL: bio_scraper-0.1.1-py3-none-any.whl
- Upload date:
- Size: 8.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
05662984154897deb346646074c06d78e819005b4511dcd4ec8d089a21025bb6
|
|
| MD5 |
1802cf47a5f167a9de40e8d4b1ce2454
|
|
| BLAKE2b-256 |
f2cd161b4426c9d5e8d2803eb48d937aca30e9b27a6bd915a5d429f6b37c43f9
|