anndata
Annotated data.
What it is and what it does
anndata is a Python library for storing and manipulating annotated data matrices—arrays with associated metadata, observations, and variables. It sits between pandas DataFrames and xarray Datasets, designed to handle scientific data efficiently whether in memory or on disk. The package supports sparse matrices, lazy operations, and multiple storage backends including HDF5 and Zarr, making it suitable for datasets that range from small in-memory arrays to larger disk-backed collections.
The library was originally built for Scanpy, a single-cell analysis toolkit, but has become a general-purpose container for annotated matrices across bioinformatics and other scientific domains. It depends on numpy, pandas, scipy, h5py, zarr, and several utility packages, giving it a stable foundation in the scientific Python ecosystem. The package is actively maintained as part of the scverse project and fiscally sponsored by NumFOCUS.
Use it for:
- Store and manipulate single-cell RNA-seq data with cell metadata and gene annotations.
- Work with large sparse matrices that don't fit efficiently in pandas or numpy alone.
- Persist annotated datasets to disk in HDF5 or Zarr format for reproducible analysis.
- Build data pipelines that combine in-memory and disk-backed operations with lazy loading.
- Integrate with Scanpy or other scverse tools for downstream bioinformatics workflows.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
anndata handles annotated data matrices in memory and on disk with sparse data support, lazy operations, and efficient storage—positioned as a middle ground between pandas and xarray for scientific data.
Yes. anndata is actively maintained, has no known vulnerabilities, low install friction, and fills a genuine need for annotated matrix storage in scientific Python. Its BSD-3-Clause permissive license poses no restriction. Install it if you work with structured scientific data—especially single-cell omics—or need sparse matrix support with metadata. The Python 3.12 or later requirement is a minor constraint for modern projects.
Install
anndata on PyPI
pip
pip install anndatauv
uv add anndatapoetry
poetry add anndataInstalling anndata
Before you install
Low install friction; pure Python wheel with 11 runtime dependencies including numpy, pandas, scipy, and zarr. Active maintenance with a release 32 days ago and ongoing commits.
License in practice
BSD-3-Clause permissive license allows commercial and private use with minimal restrictions—standard for scientific Python packages.
Quickstart
pip install anndata
import anndata
import numpy as np
X = np.random.randn(10, 5)
adata = anndata.AnnData(X=X)
adata.write_h5ad('data.h5ad')
Requires Python 3.12 or later.
Verify before relying
- Performance characteristics and scalability limits for terabyte-scale datasets mentioned in description.
- Specific lazy-loading behavior and memory footprint compared to alternatives.
- Integration depth with annbatch for minibatch data loading workflows.
Package facts
| License | BSD-3-Clause (permissive) |
| Python support | supports the current Python release (>=3.12) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 11 — array-api-compat, h5py, legacy-api-wrap, natsort, numpy, packaging, pandas, scipy, scverse-misc, typing-extensions, zarr |
| Maintenance | actively maintained — 32 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 1,812,748/month — #3,528 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: anndata-0.13.2-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
mudataMuData is a container for multimodal omics data…
permissive · top 15,000 on PyPI
spatialdataSpatialData is a data framework and…
permissive · top 15,000 on PyPI
xarrayxarray adds dimension, coordinate, and…
permissive · top 5,000 on PyPI
tabmatProvides efficient matrix classes for tabular…
unclear · top 15,000 on PyPI
scvi-toolsscvi-tools provides probabilistic models for…
permissive · top 15,000 on PyPI
formulaicFormulaic converts tabular data into model…
permissive · top 5,000 on PyPI
sparse-dot-topnPerforms fast sparse matrix multiplication with…
permissive · top 15,000 on PyPI
linopylinopy builds linear, integer, and quadratic…
permissive · top 15,000 on PyPI
spark-sklearnDistributes scikit-learn model training and…
permissive · top 15,000 on PyPI
scanpyScanpy is a toolkit for preprocessing,…
permissive · top 5,000 on PyPI