Metadata-Version: 2.4
Name: tszip
Version: 0.3.1
Summary: Compression utilities for tree sequences
Author-email: Tskit Developers <admin@tskit.dev>
License-Expression: MIT
Project-URL: Homepage, http://pypi.python.org/pypi/tszip
Project-URL: Documentation, https://tszip.readthedocs.io/en/latest/
Project-URL: Changelog, https://tszip.readthedocs.io/en/latest/changelog.html
Project-URL: Bug Tracker, https://github.com/tskit-dev/tszip/issues
Project-URL: GitHub, https://github.com/tskit-dev/tszip/
Keywords: tree sequence,tskit
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Development Status :: 5 - Production/Stable
Classifier: Environment :: Other Environment
Classifier: Intended Audience :: Science/Research
Classifier: Operating System :: POSIX
Classifier: Operating System :: MacOS :: MacOS X
Classifier: Operating System :: Microsoft :: Windows
Classifier: Topic :: Scientific/Engineering
Classifier: Topic :: Scientific/Engineering :: Bio-Informatics
Requires-Python: >=3.11
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: numpy
Requires-Dist: humanize
Requires-Dist: tskit>=1.0.0
Requires-Dist: zarr>=2.18
Dynamic: license-file

# tszip
[![License](https://img.shields.io/github/license/tskit-dev/tszip)](https://github.com/tskit-dev/tszip/blob/main/LICENSE) [![PyPI version](https://img.shields.io/pypi/v/tszip.svg)](https://pypi.org/project/tszip/) [![Supported Python Versions](https://img.shields.io/pypi/pyversions/tszip.svg)](https://pypi.org/project/tszip/) [![Docs Build](https://github.com/tskit-dev/tszip/actions/workflows/docs.yml/badge.svg)](https://github.com/tskit-dev/tszip/actions/workflows/docs.yml) [![Tests](https://github.com/tskit-dev/tszip/actions/workflows/tests.yml/badge.svg)](https://github.com/tskit-dev/tszip/actions/workflows/tests.yml) [![codecov](https://codecov.io/gh/tskit-dev/tszip/branch/main/graph/badge.svg)](https://codecov.io/gh/tskit-dev/tszip)

Gzip-like compression for [tskit](https://tskit.dev/software/tskit.html) tree sequences. Compression is lossless for supported tskit tree sequences.

Please see the [documentation](https://tskit.dev/tszip/docs/stable/) ([latest](https://tskit.dev/tszip/docs/latest/)) for more details
and [installation instructions](https://tskit.dev/tszip/docs/stable/installation.html).

## Installation

Install from PyPI or conda-forge:

```
python -m pip install tszip
# or
conda install -c conda-forge tszip
```

## Quickstart

CLI usage:

```bash
# Compress a .trees file to a .tsz archive
tszip data.trees

# Decompress back to .trees
tsunzip data.trees.tsz
```

Along with the CLI, tszip can be used directly from Python:

```python
import tskit
import tszip

ts = tskit.load("data.trees")
tszip.compress(ts, "data.trees.tsz")  # write compressed archive

# load handles .tsz archives and plain .trees files
restored = tszip.load("data.trees.tsz")
print(restored.equals(ts))  # True
```
