{"id":1657,"library":"pyppmd","title":"PPMd Compression Library","description":"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.","status":"active","version":"1.3.1","language":"en","source_language":"en","source_url":"https://github.com/miurahr/pyppmd","tags":["compression","decompression","ppmd","data-compression"],"install":[{"cmd":"pip install pyppmd","lang":"bash","label":"Install latest version"}],"dependencies":[],"imports":[{"symbol":"PPMdEncoder","correct":"from pyppmd import PPMdEncoder"},{"symbol":"PPMdDecoder","correct":"from pyppmd import PPMdDecoder"}],"quickstart":{"code":"import pyppmd\n\n# Prepare some data\noriginal_data = b\"This is a test string to be compressed multiple times. \" * 100\n\n# Initialize encoder and decoder\nencoder = pyppmd.PPMdEncoder()\ndecoder = pyppmd.PPMdDecoder()\n\n# Compress the data\ncompressed_data = encoder.compress(original_data)\nprint(f\"Original size: {len(original_data)} bytes\")\nprint(f\"Compressed size: {len(compressed_data)} bytes\")\n\n# Decompress the data\ndecompressed_data = decoder.decompress(compressed_data)\n\n# Verify decompression\nassert original_data == decompressed_data\nprint(\"Decompression successful and data matches original!\")","lang":"python","description":"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."},"warnings":[{"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.","message":"The 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.","severity":"gotcha","affected_versions":"<1.3.0, potentially current versions with specific settings"},{"fix":"Upgrade your Python environment to 3.10 or later before installing `pyppmd`.","message":"pyppmd requires Python 3.10 or newer. Attempting to install or use it on older Python versions will result in installation failures or runtime errors.","severity":"breaking","affected_versions":"All versions >=0.18.0"},{"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.","message":"While 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.","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"last_verified":"2026-04-09T00:00:00.000Z","next_check":"2026-07-08T00:00:00.000Z"}