apple-compress provides Python bindings for Apple's native libcompression framework. This library allows Python applications to utilize the highly optimized compression and decompression algorithms available on Apple operating systems (macOS, iOS, etc.). As of April 2026, the current version is 0.2.3. The release cadence is infrequent, typically aligned with bug fixes or minor enhancements rather than a strict schedule.
pip install apple-compressVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to compress and decompress a byte string using the LZFSE algorithm. The library typically exposes `compress` and `decompress` functions along with algorithm constants like `LZFSE` or `ZLIB`.
Ensure deployment environment is an Apple OS. For cross-platform compression, consider `zlib`, `lzma`, or `gzip` from the Python standard library, or other third-party libraries like `python-lz4`.
Refer to the provided quickstart and potentially examine the library's source code on GitHub for specific function signatures and available algorithms beyond the common LZFSE and ZLIB. Common functions are `compress(data, algorithm)` and `decompress(data, algorithm)`.
The library typically provides constants (e.g., `apple_compress.LZFSE`, `apple_compress.ZLIB`) for supported algorithms. Use these constants and test algorithm performance/compatibility on your specific macOS/iOS versions.