Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 39 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,42 @@
# tszip
[![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)
[![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.
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/latest/) for more details
and [installation instructions](https://tskit.dev/tszip/docs/latest/installation.html).
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

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good to add a python snippet here also as the recommended usage, as people might not realise they can just directly load

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed!

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
```
Loading