Registry / serialization / pyppmd

pyppmd

JSON →
library1.3.1pypypi✓ verified 29d ago

pyppmd is a Python wrapper for the PPMd (Prediction by Partial Matching) compression algorithm, offering both compression and decompression capabilities. It is implemented as a C-extension for performance. The current version is 1.3.1, and it receives updates periodically, primarily for maintenance, bug fixes, and minor feature enhancements.

pip install pyppmd
INSTALL
IMPORT
SIG · PYPPMD
P
pyppmd
serializationpythonv1.3.1
Install
1.7s avg
Import
106ms
Disk
16MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.9–3.13
musl
3.9–3.13
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
musl
py 3.10–3.95 runs
installs and imports cleanly · install 0.0s · import 0.110s · 18.1MB
glibc
py 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.
fix
Ensure 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.
fix
Upgrade 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.
fix
Provide 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.

Agent activity
7 hits · last 30 days
node
6
Resources
pyppmd — pip install pyppmd · libregistry