Skip to main content

PyPI-Server Unit tests

experimenthub

ExperimentHub provides an interface to access and manage data from the Bioconductor ExperimentHub service directly in Python.

It is designed to work within the BiocPy ecosystem, converting R data objects (like SingleCellExperiment or SummarizedExperiment) into their Python equivalents (e.g., SummarizedExperiment) using rds2py.

Install

To get started, install the package from PyPI

pip install experimenthub

Usage

Initialize the Registry

The registry manages the local cache of ExperimentHub metadata and resources. On the first run, it downloads the metadata database.

from experimenthub import ExperimentHubRegistry

# Initialize the registry (downloads metadata if needed)
eh = ExperimentHubRegistry()

Searching for Resources

ExperimentHub contains thousands of datasets. Use the search() method to find resources by title, description, or species.

# Search for mouse-related datasets
results = eh.search("mus musculus")

# Print the first few matches
for record in results[:5]:
    print(f"{record.ehub_id}: {record.title}")
# Output:
# EH1041: Brain scRNA-seq data, sample ...,
# EH1042: Brain scRNA-seq data, gene ...,
# ...

Inspecting Metadata

You can retrieve detailed metadata for a specific ID.

record = eh.get_record("EH4663")

print(f"Title: {record.title}")
print(f"Species: {record.species}")
print(f"Genome: {record.genome}")
print(f"Description: {record.description}")
print(f"R Class: {record.preparer_dataclass}")

## Output:
# Title: Lohoff biorXiv spatial coordinates (sample 2)
# Species: Mus musculus
# Genome: mm10
# Description: Cell spatial coordinates for sample 2 for the E8.5 seqFISH dataset from biorXiv
# R Class: character

Loading Data

The load() method handles the download, caching, and loading of the dataset.

If the resource is an R data file (.rds) containing a supported Bioconductor object (e.g., SingleCellExperiment), it is automatically read and converted to an equivalent python object using rds2py.

# Load a data.frame as an BiocFrame object
data = eh.load("EH4663")

print(data)
# BiocFrame with 8425 rows and 3 columns
#                                           x                   y             z
#                                 <FloatList>         <FloatList> <IntegerList>
#  embryo1_Pos0_cell10_z5  0.7084368794499625 -2.7071263060540645             5
# embryo1_Pos0_cell100_z5  0.9763043488304248  -2.517971233335359             5
# embryo1_Pos0_cell101_z5  0.9749347757408557 -2.6739635081030855             5
#                                         ...                 ...           ...
# embryo1_Pos28_cell97_z5 -1.3992279805347039  3.1761928631722824             5
# embryo1_Pos28_cell98_z5  -1.389353519722718  3.1349508225406666             5
# embryo1_Pos28_cell99_z5  -1.394992277928857  2.5812717935734355             5

Supported File Formats

ExperimentHub supports downloading and parsing both .rds and .rda / .rdata files.

  • .rds files return the parsed Python equivalent object directly (e.g. SummarizedExperiment).
  • .rda or .rdata files return a Python dictionary mapping serialized variable names to their parsed Python object representations.

Note

This project has been set up using BiocSetup and PyScaffold.

Release files for experimenthub 0.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for experimenthub 0.0.2
File Size Uploaded
experimenthub-0.0.2.tar.gz 25.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for experimenthub 0.0.2
File Interpreter ABI Platform
experimenthub-0.0.2-py3-none-any.whl Python 3 none any Details

Total release size: 34.6 kB

Release files / experimenthub-0.0.2.tar.gz

Download URL experimenthub-0.0.2.tar.gz
Size 25.8 kB
Tags Source
SHA-256 checksum
How to use checksums
9012bac6dbef1e1e5e088e70d3fb720a9ce0c0ea6aedfdcbc1826cb4af523607
BLAKE2b-256 checksum
How to use checksums
1a9281ec9ebd24b6ed1a42c8bfbc19994e504da9cc04805f6900992826734e59
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 10, 2026.

Transparency log

Release files / experimenthub-0.0.2-py3-none-any.whl

Download URL experimenthub-0.0.2-py3-none-any.whl
Size 8.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
02c4ce06230c34446d58d7c07b5731879f0d8f12e410a8fbd87d67ae98b470f2
BLAKE2b-256 checksum
How to use checksums
40101af3ef9fc3a683bfb4b9ff374797464a1f8f6e2a81777742e044b1acde62
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 10, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.0.2 This release

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page