Registry / serialization / apple-compress

apple-compress

JSON →
library0.2.3pypypiunverified

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-compress
INSTALL
IMPORT
SIG · APPLE-COMPRESS
A
apple-compress
serializationpythonv0.2.3
Install
1.7s avg
Import
Disk
17MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.2.3 · 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.103.920 runs
installs and imports cleanly · install 0.0s · import 0.000s · 19.1MB
glibc
py 3.103.920 runs
installs and imports cleanly · install 1.7s · import 0.000s · 20MB
17MB installed
● package 17MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

compress
from apple_compress import compress
from apple_compress import compress

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`.

import apple_compress original_data = b"This is some data to be compressed by apple-compress using LZFSE!" print(f"Original data length: {len(original_data)} bytes") # Compress data using the LZFSE algorithm compressed_data = apple_compress.compress(original_data, algorithm=apple_compress.LZFSE) print(f"Compressed data length: {len(compressed_data)} bytes") print(f"Compressed data (first 50 bytes): {compressed_data[:50]}...") # Decompress data using the same algorithm decompressed_data = apple_compress.decompress(compressed_data, algorithm=apple_compress.LZFSE) print(f"Decompressed data length: {len(decompressed_data)} bytes") assert original_data == decompressed_data print("Decompression successful! Original and decompressed data match.")
Debug
Known issues
breakingThis library is designed for and only functions on Apple operating systems (macOS, iOS, watchOS, tvOS). Attempting to use it on Linux, Windows, or other non-Apple platforms will result in runtime errors due to missing native 'libcompression' functionality.
fix
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`.
affects: All versions
gotchaThe official GitHub README links to a 'Library API Usage' wiki page which does not exist or is not publicly accessible. Users need to infer API usage from source code or examples.
fix
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)`.
affects: All versions
gotchaThe available compression algorithms are dictated by Apple's `libcompression` and may vary slightly or have different performance characteristics across various Apple OS versions. Always test on your target OS version.
fix
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.
affects: All versions
Upgrade
Version history
0.2.3latest on PyPI · released Apr 5, 2024
Audit
Dependencies
PythonrequiredRequires Python 3.8 or higher.
libcompression (Apple framework)requiredThis library provides Python bindings to Apple's native C library, which is only available on Apple operating systems (*OS).
Agent activity
23 hits · last 30 days
node
22
OpenAI (training)
1
Resources
apple-compress — pip install apple-compress · libregistry