asdf
Python implementation of the ASDF Standard
What it is and what it does
ASDF is a file format and Python library for storing scientific data with structured, human-readable metadata in YAML and efficient binary storage for arrays. It combines hierarchical metadata validation via JSON Schema with lazy-loading and optional memory-mapping of array data, making it suitable for interchange of complex scientific datasets. The package handles native Python types transparently and supports custom extensions for domain-specific objects.
Typical workflows involve creating a nested dictionary tree of data and metadata, writing it to an ASDF file with optional compression (zlib, bzp2, or lz4), and later reading it back with lazy array access. The format is designed for scientific data interchange and long-term archival, with support for flexible compression and schema-based validation to ensure data integrity.
Use it for:
- Store and share multi-dimensional numpy arrays alongside structured metadata in a single validated file.
- Archive scientific simulation results with hierarchical metadata and compression for efficient storage.
- Exchange complex scientific datasets between Python applications with schema validation and human-readable metadata.
- Load large array data on demand via memory mapping without loading the entire file into memory.
- Extend ASDF with custom tags to serialize domain-specific Python objects alongside standard scientific data.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
ASDF is a Python implementation of the Advanced Scientific Data Format, a file format for storing hierarchical scientific data with human-readable YAML metadata and efficient binary array storage.
Yes. ASDF is actively maintained, has low install friction, and solves a genuine need for structured scientific data interchange. The unclear license status is a minor concern that should be resolved by checking the repository before use in proprietary contexts, but it does not block evaluation. The package is well-suited for scientific workflows involving numpy arrays and hierarchical metadata.
Install
asdf on PyPI
pip
pip install asdfuv
uv add asdfpoetry
poetry add asdfInstalling asdf
Before you install
Low install friction with a pure-Python wheel distribution. Actively maintained with recent releases; last commit 2026-08-14 and latest release 2026-06-08 indicate ongoing development.
License in practice
License treatment is unclear—no SPDX identifier or raw license text is available in the metadata. Verify the actual license by checking the repository or package source before use in proprietary or restricted contexts.
Quickstart
import asdf
import numpy as np
tree = {"data": np.arange(100)}
af = asdf.AsdfFile(tree)
af.write_to("example.asdf")
af_read = asdf.open("example.asdf")
print(af_read["data"])
Requires Python 3.10 or later.
Verify before relying
- Whether the unclear license status reflects a genuine licensing gap or a metadata cataloging issue in the fact sheet.
- Performance characteristics and typical file sizes for which memory mapping provides practical benefit.
Package facts
| License | not declared (unclear) |
| Python support | supports the current Python release (>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 8 — asdf-standard, importlib-metadata, jmespath, numpy, packaging, pyyaml, semantic_version, attrs |
| Maintenance | actively maintained — 67 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 326,850/month — #7,571 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: asdf-5.3.1-py3-none-any.whl
Tags
More Scientific/Engineering packages
NumPy provides an N-dimensional array object…
permissive · top 100 on PyPI
pandaspandas provides fast, flexible data structures…
permissive · top 100 on PyPI
scipyscipy provides numerical algorithms for…
permissive · top 100 on PyPI
scikit-learnscikit-learn provides a comprehensive Python…
permissive · top 1,000 on PyPI
dilldill extends Python's pickle module to…
permissive · top 1,000 on PyPI
multiprocessMultiprocess is an enhanced fork of Python's…
permissive · top 1,000 on PyPI
asdf-astropyProvides ASDF serialization plugins for astropy…
unclear · top 15,000 on PyPI
asdf-standardProvides the ASDF (Advanced Scientific Data…
unclear · top 15,000 on PyPI
asdf-transform-schemasProvides ASDF schemas for validating transform…
unclear · top 15,000 on PyPI
asdf-coordinates-schemasProvides ASDF schemas for validating coordinate…
unclear · top 15,000 on PyPI
asdf-wcs-schemasProvides ASDF schemas for validating World…
unclear · top 15,000 on PyPI
numpydanticNumpydantic adds type annotations and…
permissive · top 15,000 on PyPI
PyYAMLPyYAML parses and emits YAML 1.1 data format,…
permissive · top 100 on PyPI
fitsiofitsio reads and writes FITS (Flexible Image…
copyleft · top 15,000 on PyPI
xarray-dataclassDefines typed xarray DataArray and Dataset…
permissive · top 15,000 on PyPI
zopfliZopfli is a Python binding for Google's Zopfli…
permissive · top 1,000 on PyPI