Skip to main content

No project description provided

Project description

SimpleZstd

This library provides simple Pythonic interface of zstd algorithm like Python's builtin gzip library, by wrapping the zstandard library.

Further more, it provides builtin session support to take advantage of zstd's powerful training mode without additional user effort, by auto collecting training samples (10 by default) during compression/decompression.

In [1]: c = open("poetry.lock").read().encode("utf-8")

In [2]: len(c)
Out[2]: 73946

In [3]: from simple_zstd import compress, decompress

In [4]: for i in range(10):
   ...:     x = compress(c)
   ...:     print(len(x), len(x) / len(c))
   ...:     assert decompress(x) == c
   ...:
22259 0.3010169583209369
22259 0.3010169583209369
22259 0.3010169583209369
22259 0.3010169583209369
22259 0.3010169583209369
7123 0.09632704946853109
7123 0.09632704946853109
7123 0.09632704946853109
7123 0.09632704946853109
7123 0.09632704946853109

Note that user can also choose to have dedicated session instead of default one.

In [1]: c = open("poetry.lock").read().encode("utf-8")

In [2]: from simple_zstd import Session

In [3]: session = Session()

In [4]: x = session.compress(c)

In [5]: assert session.decompress(x) == c

For simpler usage, you can also just import zstd instead of simple_zstd.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

simple_zstd-0.1.0.tar.gz (42.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

simple_zstd-0.1.0-py3-none-any.whl (3.1 kB view details)

Uploaded Python 3

File details

Details for the file simple_zstd-0.1.0.tar.gz.

File metadata

  • Download URL: simple_zstd-0.1.0.tar.gz
  • Upload date:
  • Size: 42.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.6.8

File hashes

Hashes for simple_zstd-0.1.0.tar.gz
Algorithm Hash digest
SHA256 414c971c1319f5083bf5361d4cee5c8f57c8857d0735ffebef40b0436ae8f3f4
MD5 8f60fefd0d65d4da1d7491137b441fac
BLAKE2b-256 9d57b989a93f273a472e41eca9fa521def690b1526e61f891e6c66e2e5b3a5bf

See more details on using hashes here.

File details

Details for the file simple_zstd-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for simple_zstd-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 411ea5012b7d621308dedc5e5e64dd96ceee085b8e0da0192ba802284d5191fa
MD5 1cc2cb864f5d73f354d2fe5817a66b6f
BLAKE2b-256 bcda6533c242d01de07d79e52d5a0deeada6aa9467fb70db8be761c422e1a5c9

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page