Registry / data / cellxgene-census

cellxgene-census

JSON →
library1.17.0pypypiunverified

Python API to facilitate access to and analysis of the CZ CELLxGENE Discover Census, a curated collection of single-cell RNA-seq data. As of v1.17.0, requires Python 3.10-3.12. Released monthly.

pip install cellxgene-census
INSTALL
IMPORT
SIG · CELLXGENE-CENSUS
C
cellxgene-census
datapythonv1.17.0
Install
37.1s avg
Import
4263ms
Disk
1060MB
Pass rate
4/ 10
Env Coverage4 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v1.17.0 · 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
glibc
py 3.10
✕ build_error
✓ 35.3s
py 3.11
✕ build_error
✓ 35.2s
py 3.12
✕ build_error
✓ 33.6s
py 3.13
✕ build_error
✕ build_error
py 3.9
✕ build_error
✓ 44.5s
1060MB installed
● package 1060MB
Code
Verified usage

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

open_soma
from cellxgene_census import open_soma
from cellxgene_census.experiment import open_soma
Function is at package level, not in experiment submodule
get_anndata
from cellxgene_census import get_anndata
from cellxgene_census.anndata import get_anndata
Moved to top-level in v1.7+
CensusExperiment
from cellxgene_census.experiment import CensusExperiment
from cellxgene_census import CensusExperiment
Class is in experiment submodule

Open latest stable Census version (year-month-day string) and fetch a subset of data for select genes.

from cellxgene_census import open_soma, get_anndata with open_soma(census_version='2023-12-01') as census: adata = get_anndata( census=census, organism='Homo sapiens', measurement_name='RNA', var_value_filter='feature_id in %(var_list)s', var_value_filters={'var_list': ['ENSG00000161798', 'ENSG00000188229']} ) print(adata.shape)
cellxgene-census --version
Debug
Known issues
breakingCensus versions are date-stamped (e.g., '2023-12-01') and older versions are periodically retired. Always specify a valid, recent version or use 'latest' with caution.
fix
Pin to a specific version string or use the 'latest' alias, but be aware that 'latest' may change under you.
affects: all
deprecatedThe `cellxgene_census.get_anndata` API underwent changes in v1.7: the 'X_name' parameter was renamed to 'X_layers' and 'obs_value_filter' became 'obs_coords'. Old code will raise TypeError.
fix
Update calls: replace `X_name='counts'` with `X_layers=['counts']` and `obs_value_filter` with `obs_coords`.
affects: <1.7
gotchaThe Census uses TileDB arrays; concurrent writes are not allowed. Multiple processes opening the same Census for writing will corrupt data.
fix
Always open with `open_soma(mode='r')` unless you explicitly need to modify the Census (very rare).
affects: all
Upgrade
Version history
1.17.0latest on PyPI · released Apr 2, 2025
Audit
Dependencies
tiledbrequiredBackend storage engine for Census data
tiledbsomarequiredSOMA API over TileDB
anndatarequiredAnnData object creation
Agent activity
15 hits · last 30 days
node
14
OpenAI (training)
1
Resources
cellxgene-census — pip install cellxgene-census · libregistry