Metadata-Version: 2.4
Name: tensogram
Version: 0.20.0
Classifier: Development Status :: 4 - Beta
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Programming Language :: Rust
Classifier: Topic :: Scientific/Engineering
Classifier: Topic :: Scientific/Engineering :: Atmospheric Science
Requires-Dist: numpy>=2.1
Requires-Dist: tensogram[xarray] ; extra == 'all'
Requires-Dist: tensogram[zarr] ; extra == 'all'
Requires-Dist: pytest>=7.0 ; extra == 'dev'
Requires-Dist: pytest-asyncio>=0.23 ; extra == 'dev'
Requires-Dist: ruff>=0.15 ; extra == 'dev'
Requires-Dist: tensogram-xarray>=0.20.0,<0.21 ; extra == 'xarray'
Requires-Dist: tensogram-zarr>=0.20.0,<0.21 ; extra == 'zarr'
Provides-Extra: all
Provides-Extra: dev
Provides-Extra: xarray
Provides-Extra: zarr
Summary: Fast binary N-tensor message format for scientific data
Author-email: ECMWF <software@ecmwf.int>
License-Expression: Apache-2.0
Requires-Python: >=3.11
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
Project-URL: Changelog, https://github.com/ecmwf/tensogram/blob/main/CHANGELOG.md
Project-URL: Documentation, https://sites.ecmwf.int/docs/tensogram/main
Project-URL: Homepage, https://sites.ecmwf.int/docs/tensogram/main
Project-URL: Repository, https://github.com/ecmwf/tensogram

# Tensogram Python Bindings

Python bindings for the Tensogram N-tensor message format.

Native extension built with PyO3 + maturin. Supports NumPy arrays,
async I/O, and GIL-free operation on free-threaded Python (3.13t / 3.14t).

## Installation

```bash
pip install tensogram
# or, with the xarray and Zarr backends:
pip install tensogram[all]
```

## Usage

```python
import numpy as np
import tensogram

data = np.random.randn(100, 200).astype(np.float32)
msg = tensogram.encode(
    {"version": 3},
    [(
        {"type": "ntensor", "shape": [100, 200], "dtype": "float32",
         "compression": "szip"},
        data,
    )],
)
result = tensogram.decode(msg)
arr = result.objects[0][1]   # numpy array
```

## Features

- NumPy integration across every supported dtype (float / complex /
  int / uint, plus `bitmask` and `bfloat16`)
- Sync and async file APIs (`TensogramFile` / `AsyncTensogramFile`)
- GIL-free parallel encode / decode on free-threaded Python
- Partial-range decode (`decode_range`)
- Full codec support: szip, zstd, lz4, blosc2, zfp, sz3
- Validation (`tensogram.validate`, `tensogram.validate_file`)
- GRIB / NetCDF conversion (when the wheel is built with the matching
  feature)

## Documentation

- Full documentation: <https://sites.ecmwf.int/docs/tensogram/main/>
- Python user guide: <https://sites.ecmwf.int/docs/tensogram/main/guide/python-api.html>
- Repository: <https://github.com/ecmwf/tensogram>

## License

Copyright 2026- ECMWF. Licensed under Apache-2.0. See LICENSE.

