scanpy
Single-Cell Analysis in Python.
What it is and what it does
Scanpy is a Python toolkit for single-cell genomics that handles the full workflow of analyzing gene expression data: reading and preprocessing raw counts, normalizing and scaling, dimensionality reduction, clustering, and statistical testing for differential expression. It is built on top of anndata for efficient data representation and integrates with the broader scverse ecosystem. The package is designed to scale from small pilot studies to datasets with over one million cells, and experimental dask support allows some operations on data larger than available memory.
The toolkit combines visualization (via matplotlib and seaborn), unsupervised learning (via scikit-learn and custom algorithms), and statistical inference (via statsmodels and scipy) into a unified API. It is actively maintained, production-stable, and widely used in academic and research settings for exploratory analysis, cell type discovery, and trajectory inference.
Use it for:
- Preprocessing and quality control of raw single-cell RNA-seq count matrices before downstream analysis.
- Unsupervised clustering and visualization of cell populations to identify cell types or states.
- Differential expression testing between cell groups to find marker genes or disease-associated changes.
- Trajectory inference to reconstruct developmental or differentiation paths from snapshot data.
- Integration with external tools via anndata format for multi-tool pipelines in single-cell studies.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Scanpy is a toolkit for preprocessing, visualizing, clustering, and analyzing single-cell gene expression data, handling datasets from hundreds to millions of cells efficiently.
Yes. Scanpy is a mature, actively maintained toolkit with no known vulnerabilities, permissive licensing, and low install friction. It is the standard choice for single-cell gene expression analysis in Python. Install it if you work with single-cell RNA-seq or similar high-dimensional genomic data; the large dependency tree is a one-time cost for a comprehensive, well-documented analysis platform.
Install
scanpy on PyPI
pip
pip install scanpyuv
uv add scanpypoetry
poetry add scanpyInstalling scanpy
Before you install
Low install friction with a pure-wheel distribution. Active maintenance with a release 21 days ago and ongoing commits. Requires Python 3.12 or later. Brings 24 runtime dependencies including heavy scientific stacks (numpy, scipy, scikit-learn, pandas, matplotlib), so initial installation is substantial but straightforward.
License in practice
BSD-3-Clause (permissive) allows commercial and private use with minimal restrictions—you must include a copy of the license and the original copyright notice in distributions.
Quickstart
pip install scanpy
import scanpy as sc
adata = sc.read_h5ad('data.h5ad')
sc.pp.normalize_total(adata)
sc.tl.pca(adata)
sc.pl.pca(adata)
Requires Python 3.12 or later. Large dependency tree (numpy, scipy, scikit-learn, pandas, matplotlib, etc.) may take time to resolve and install on first run.
Verify before relying
- Whether dask integration for out-of-core analysis is production-ready or remains experimental as the description suggests.
- Performance characteristics and memory usage on datasets approaching or exceeding one million cells in practice.
Package facts
| License | BSD-3-Clause (permissive) |
| Python support | supports the current Python release (>=3.12) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 24 — anndata, certifi, fast-array-utils, h5py, joblib, legacy-api-wrap, matplotlib, natsort, networkx, numba, numpy, packaging, pandas, patsy, pynndescent, scikit-learn, scipy, scverse-misc, seaborn, session-info2, statsmodels, tqdm, typing-extensions, umap-learn |
| Maintenance | actively maintained — 21 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 1,038,260/month — #4,459 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: scanpy-1.12.3-py3-none-any.whl
Tags
More Visualization packages
matplotlib creates static, animated, and…
permissive · top 1,000 on PyPI
contourpyContourPy calculates contours of 2D…
permissive · top 1,000 on PyPI
plotlyPlotly is an interactive, browser-based…
permissive · top 1,000 on PyPI
graphvizGenerates DOT language source code for graph…
permissive · top 1,000 on PyPI
streamlitStreamlit transforms Python scripts into…
permissive · top 1,000 on PyPI
leatherLeather is a lightweight Python charting…
permissive · top 1,000 on PyPI
pydeseq2PyDESeq2 performs differential expression…
permissive · top 15,000 on PyPI
scvi-toolsscvi-tools provides probabilistic models for…
permissive · top 15,000 on PyPI
cobraCOBRApy is a constraint-based modeling package…
copyleft · top 15,000 on PyPI
somacoreProvides the Python reference implementation of…
permissive · top 15,000 on PyPI
gseapyPerforms gene set enrichment analysis (GSEA) on…
permissive · top 15,000 on PyPI
cellxgene-censusProvides a Python API to query and retrieve…
permissive · top 15,000 on PyPI
spatialdataSpatialData is a data framework and…
permissive · top 15,000 on PyPI
tiledbsomaTileDB-SOMA is a Python implementation of the…
permissive · top 15,000 on PyPI
anndataanndata handles annotated data matrices in…
permissive · top 5,000 on PyPI
peppypeppy reads and manages Portable Encapsulated…
permissive · top 15,000 on PyPI