Install & Compatibility
Where this runs
tested against v1.3.1 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslpy 3.10–3.95 runs
installs and imports cleanly · install 0.0s · import 0.110s · 18.1MB
glibcpy 3.10–3.95 runs
installs and imports cleanly · install 1.7s · import 0.102s · 19MB
16MB installed
● package 16MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
Ppmd7Encoder
✓ from pyppmd import Ppmd7Encoder
✗ from pyppmd import PPMdEncoder
Ppmd7Decoder
✓ from pyppmd import Ppmd7Decoder
compress
✓ from pyppmd import compress
This quickstart demonstrates the basic usage of pyppmd to compress and decompress a byte string. It initializes an `Encoder` and `Decoder`, processes data, and then verifies the integrity of the decompressed output.
import pyppmd
# Prepare some data
original_data = b"This is a test string to be compressed multiple times. " * 100
# Initialize encoder and decoder
encoder = pyppmd.PPMdEncoder()
decoder = pyppmd.PPMdDecoder()
# Compress the data
compressed_data = encoder.compress(original_data)
print(f"Original size: {len(original_data)} bytes")
print(f"Compressed size: {len(compressed_data)} bytes")
# Decompress the data
decompressed_data = decoder.decompress(compressed_data)
# Verify decompression
assert original_data == decompressed_data
print("Decompression successful and data matches original!")
Debug
Known issues
gotchaThe PPMd8 Decoder, particularly in versions prior to 1.x, has known issues including incorrect output, wrong end-of-file (EOF) status detection, and potential deadlocks with certain parameter combinations. While improvements have been made, caution is advised.fixEnsure you are on the latest version of `pyppmd`. Carefully test with your specific data and parameters. Avoid experimental or non-default `restore_method` or `endmark` options for `PPMd8Decoder` unless thoroughly validated.
affects: <1.3.0, potentially current versions with specific settings
breakingpyppmd requires Python 3.10 or newer. Attempting to install or use it on older Python versions will result in installation failures or runtime errors.fixUpgrade your Python environment to 3.10 or later before installing `pyppmd`.
affects: All versions >=0.18.0
gotchaWhile pyppmd generally handles data streams, the `compress` and `decompress` methods are designed for single-shot operations with complete byte strings. Using them incrementally or with partial data without careful state management may lead to corruption or errors.fixProvide complete byte strings to `compress` and `decompress` methods. For streaming scenarios, consider buffering data or implementing higher-level stream processing on top of `pyppmd`'s block-wise operations.
affects: All versions
Upgrade
Version history
1.3.1latest on PyPI · released Nov 27, 2025
Audit
Dependencies
No dependency data recorded yet.