$npx skillfedfor your agent

xarray-dataclass

xarray data creation by data classes

Worth itPyPI Scientific/EngineeringReleased Jul 202578.2K downloads / mopermissive licensePure Python

Decision gist · record as of 2026-08-14

pure-Python wheel — xarray_dataclass-3.0.0-py3-none-any.whl
v3.0.0 · released 2025-07-30 · Python >=3.9 · 3 runtime deps: numpy, typing-extensions, xarray

Yes. The package is actively maintained, has low install friction, carries a permissive MIT license, and solves a real problem for teams working with xarray who want type safety and schema enforcement. It is well-suited for scientific computing and data-analysis workflows where consistency and static checking add value. No known vulnerabilities.AI-flagged interpretation of the facts on this page — verify before relying

Before you install

  • Requires Python 3.9 or later; xarray and numpy must be installed.
  • Low friction install with only three runtime dependencies (numpy, typing-extensions, xarray).
  • Active maintenance as of August 2026 with recent commits.

License · maintenance · safety

permissive license (permissive) — MIT License permits commercial and private use with minimal restrictions; you may use, modify, and distribute the package freely provided you include the original copyright notice.

last release 2025-07-30 (380 days) · last repo commit 2026-08-10 · 11 stars

0 known vulnerabilities (OSV.dev, 2026-08-14) · 78,169 downloads/mo, #14,465 on PyPI

Verify before relying

pip install xarray-dataclass

from dataclasses import dataclass
from typing import Literal
from xarray_dataclass import AsDataArray, Data, Coord

X, Y = Literal["x"], Literal["y"]

@dataclass
class Image(AsDataArray):
    data: Data[tuple[X, Y], float]
    x: Coord[X, int] = 0
    y: Coord[Y, int] = 0

image = Image.new([[0, 1], [2, 3]], x=[0, 1], y=[0, 1])
  • Whether static type checking with Pyright works as advertised for all dimension and dtype combinations.
  • Performance characteristics when working with large multidimensional arrays compared to raw xarray.
  • Compatibility with xarray's latest versions beyond what the dependency specification guarantees.
Same gist for agents: .md · .json

What it is and what it does

xarray-dataclass wraps xarray's DataArray and Dataset objects in a dataclass-based interface, letting you declare typed multidimensional data structures with fixed dimensions, coordinates, and attributes at definition time. Instead of building xarray objects imperatively with method calls, you define a dataclass using special type hints (Data, Coord, Attr, Name) that encode the structure, then instantiate it with `.new()` or NumPy-like factory methods (`.zeros()`, `.ones()`). The package validates that your data matches the declared schema and provides static type checking support through Pyright.

It is primarily useful for scientific and data-analysis workflows where you want to enforce a consistent structure across xarray objects—for example, ensuring all images in a batch have the same dimensions and dtype, or defining reusable templates for multidimensional datasets. The package depends on numpy, xarray, and typing-extensions; it is actively maintained and supports Python 3.9 through 3.13.

Use it for

  • Define reusable typed templates for multidimensional scientific data (e.g., images, time series, gridded fields) with fixed dimensions and dtypes.
  • Create xarray DataArrays or Datasets with static type checking to catch dimension/dtype mismatches at development time.
  • Build batch processing pipelines where all inputs must conform to a declared schema (e.g., all images must be 2D float arrays with x and y coordinates).
  • Attach metadata (attributes, coordinate names) to xarray objects declaratively rather than imperatively after creation.
  • Generate xarray objects with NumPy-like constructors (zeros, ones) while enforcing the declared structure.

Worth the install?

AI-flagged interpretation of the facts on this page. Verify before relying on it.

Worth it

Yes.

The package is actively maintained, has low install friction, carries a permissive MIT license, and solves a real problem for teams working with xarray who want type safety and schema enforcement. It is well-suited for scientific computing and data-analysis workflows where consistency and static checking add value. No known vulnerabilities.

Install

xarray-dataclass on PyPI

Before you install

Low friction install with only three runtime dependencies (numpy, typing-extensions, xarray). Active maintenance as of August 2026 with recent commits.

Requires Python 3.9 or later; xarray and numpy must be installed.

License in practice

MIT License permits commercial and private use with minimal restrictions; you may use, modify, and distribute the package freely provided you include the original copyright notice.

Quickstart

pip install xarray-dataclass

from dataclasses import dataclass
from typing import Literal
from xarray_dataclass import AsDataArray, Data, Coord

X, Y = Literal["x"], Literal["y"]

@dataclass
class Image(AsDataArray):
    data: Data[tuple[X, Y], float]
    x: Coord[X, int] = 0
    y: Coord[Y, int] = 0

image = Image.new([[0, 1], [2, 3]], x=[0, 1], y=[0, 1])

Verify before relying

  • Whether static type checking with Pyright works as advertised for all dimension and dtype combinations.
  • Performance characteristics when working with large multidimensional arrays compared to raw xarray.
  • Compatibility with xarray's latest versions beyond what the dependency specification guarantees.

Package facts

Licensepermissive license permissive
Python supportSupports the current Python release >=3.9
Install frictionLow. Pure-Python wheel
Runtime dependencies
3 packages
numpytyping-extensionsxarray
MaintenanceActively maintained 380 days since the last release
Last repo commit
First released
Downloads78,169 / month, #14,465 on PyPI 30-day window, as of 2026-08-14
Known vulnerabilitiesNone known OSV.dev, checked 2026-08-14
Classifiers
License :: OSI Approved :: MIT LicenseProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.9

Evidence: xarray_dataclass-3.0.0-py3-none-any.whl

Tags

Capabilities
typed xarray dataarraydataclass xarray integrationxarray dataset with typesnumpy array with type hintsstructured xarray creation
Topics
type-safetyscientific-computingdata-structures
PyPI keywords
dataarraydataclassdatasettypingxarray

Let your AI agent find packages like this

Example. Real query, live index.

You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.

wish › “typed xarray dataarray”

Give your agent the search over MCP, or paste the wish link into any chat.

More Scientific/Engineering packages

numpy Worth it
PyPI · Software Development · released Aug 2026

NumPy provides an N-dimensional array object and a comprehensive suite of mathematical, linear algebra, Fourier transform, and random number functions for scientific computing in Python.

BSD-3-Clause AND 0BSD AND MIT AND Zlib AND CC0-1.0compiled wheel · 3.12+
1.1Bdownloads / mo
pandas Worth it
PyPI · Scientific/Engineering · released Jul 2026

pandas provides fast, flexible data structures (Series and DataFrame) for loading, cleaning, transforming, and analyzing labeled or relational data in Python.

BSD-3-Clausecompiled wheel · 3.11+
769.1Mdownloads / mo
scipy Worth it
PyPI · Libraries · released Jun 2026

scipy provides numerical algorithms for mathematics, science, and engineering—including optimization, integration, linear algebra, Fourier transforms, signal and image processing, and ODE solvers—built on numpy arrays.

BSD-3-Clausecompiled wheel · 3.12+
449.0Mdownloads / mo
scikit-learn Worth it
PyPI · Software Development · released Jun 2026

scikit-learn provides a comprehensive Python library for supervised and unsupervised machine learning, including classification, regression, clustering, dimensionality reduction, and model evaluation tools built on NumPy and SciPy.

Install it if you need to train, evaluate, or deploy supervised or unsupervised learning models.

BSD-3-Clausecompiled wheel · 3.11+
235.5Mdownloads / mo
dill Worth it
PyPI · Software Development · released Jan 2026

dill extends Python's pickle module to serialize and deserialize a much wider range of Python objects, including functions, lambdas, classes, and interpreter sessions, to byte streams for storage or network transmission.

BSD-3-Clausepure Python · 3.9+
208.1Mdownloads / mo
multiprocess Worth it
PyPI · Software Development · released Jan 2026

Multiprocess is an enhanced fork of Python's standard multiprocessing library that uses dill for better serialization, allowing you to spawn processes with a threading-like API and share complex objects between them.

Install it if you use multiprocessing and encounter pickle serialization limits with lambdas or complex objects.

BSD-3-Clausepure Python · 3.9+
202.7Mdownloads / mo

See also pint-xarray · spatial_image · xarray · cf-xarray · multiscale-spatial-image · xproj · abstractcp · typed-json-dataclass · dataclass-csv · odc-loader