Metadata-Version: 2.4
Name: tszip
Version: 0.3.0
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.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
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.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: numpy
Requires-Dist: humanize
Requires-Dist: tskit>=0.3.3
Requires-Dist: numcodecs>=0.6.4
Requires-Dist: zarr<4,>=2.17
Provides-Extra: test
Requires-Dist: humanize==4.13.0; extra == "test"
Requires-Dist: h5py==3.14.0; extra == "test"
Requires-Dist: msprime==1.3.4; extra == "test"
Requires-Dist: pytest==8.4.2; extra == "test"
Requires-Dist: pytest-cov==6.3.0; extra == "test"
Requires-Dist: pytest-xdist==3.8.0; extra == "test"
Requires-Dist: tskit==1.0.0; extra == "test"
Requires-Dist: zarr==2.18.3; python_version == "3.10" and extra == "test"
Requires-Dist: zarr==3.1.2; python_version >= "3.11" and extra == "test"
Requires-Dist: numcodecs<0.15.1,>=0.6; extra == "test"
Provides-Extra: docs
Requires-Dist: humanize==4.13.0; extra == "docs"
Requires-Dist: jupyter-book==1.0.4.post1; extra == "docs"
Requires-Dist: sphinx-issues==5.0.1; extra == "docs"
Requires-Dist: sphinx-argparse==0.5.2; extra == "docs"
Requires-Dist: setuptools_scm==9.2.0; extra == "docs"
Requires-Dist: tskit==1.0.0; extra == "docs"
Requires-Dist: zarr==3.1.2; extra == "docs"
Requires-Dist: numcodecs<0.15.1,>=0.6; extra == "docs"
Provides-Extra: dev
Requires-Dist: codecov; extra == "dev"
Requires-Dist: coverage; extra == "dev"
Requires-Dist: flake8; extra == "dev"
Requires-Dist: h5py; extra == "dev"
Requires-Dist: jupyter-book<2; extra == "dev"
Requires-Dist: pre-commit; extra == "dev"
Requires-Dist: pytest; extra == "dev"
Requires-Dist: pytest-cov; extra == "dev"
Requires-Dist: pytest-xdist; extra == "dev"
Requires-Dist: sphinx-argparse; extra == "dev"
Requires-Dist: sphinx_rtd_theme; extra == "dev"
Requires-Dist: sphinx-issues; extra == "dev"
Requires-Dist: setuptools_scm; extra == "dev"
Requires-Dist: tskit; extra == "dev"
Requires-Dist: zarr; extra == "dev"
Requires-Dist: msprime; extra == "dev"
Requires-Dist: humanize; extra == "dev"
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) [![Binary wheels](https://github.com/tskit-dev/tszip/actions/workflows/wheels.yml/badge.svg)](https://github.com/tskit-dev/tszip/actions/workflows/wheels.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

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