--- id: ncompress version: "1.0.2" license: This is free and unencumbered software released into the public domain. Anyone is free to copy, modify, publish, use, compile, sell, or distribute this software, either in source code form or as a… (full text in the JSON record) license_treatment: permissive maintenance: dormant --- # ncompress — LZW compression and decompression License: permissive · Maintenance: dormant · Downloads: 177.2K/mo ## What it is and what it does ncompress is a Python binding to LZW compression, ported from the classic (N)compress CLI tool. It exposes two main functions—compress() and decompress()—that work with either raw bytes or BytesIO objects, returning compressed or decompressed data respectively. The library is implemented in C++ with Python bindings, offering a direct port of the original compress algorithm with minimal changes. The package has no runtime dependencies and ships as pre-compiled wheels for Python 3.8+ across macOS, Linux, and Windows on multiple architectures. It's designed for straightforward use: pass data in, get compressed or decompressed output back. The BytesIO variants are slightly faster because they avoid an intermediate copy during bytes-to-string conversion. Use it for: - Compress or decompress data using the classic LZW algorithm when compatibility with (N)compress format is needed. - Integrate LZW compression into Python applications without external CLI tool dependencies. - Process large BytesIO streams with minimal memory overhead by using the BytesIO-based compress/decompress functions. - Archive or transmit data using a well-established, lossless compression format. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Provides LZW compression and decompression functions that accept bytes or BytesIO objects and return compressed or decompressed data. Yes, if you need LZW compression specifically or must work with (N)compress-compatible data. The permissive license, zero runtime dependencies, and broad platform support make it low-friction to add. However, maintenance is dormant (last release 927 days ago), so consider whether you need active support or would prefer a more actively maintained compression library for general-purpose use. ## Install pip install ncompress uv add ncompress poetry add ncompress ## Installing ncompress Before you install: Medium install friction due to compiled wheels; however, wheels are pre-built for Python 3.8+ across all major platforms and architectures, making installation straightforward. Maintenance is dormant—last release was 927 days ago, though the repository remains active. License in practice: Released under the Unlicense (public domain dedication) with permissive treatment, meaning you can use, modify, and distribute it freely with no restrictions. A small portion (BytesIO wrapper) is adapted from cctbx under the Lawrence Berkeley National Labs BSD variant license; see the source file for details. Quickstart: pip install ncompress from ncompress import compress, decompress original = b'hello world' compressed = compress(original) decompressed = decompress(compressed) Requires Python 3.8 or later. Verify before relying: - Performance characteristics compared to other LZW or general-purpose compression libraries in typical use cases. - Whether the 15% speed advantage of BytesIO-based functions over bytes conversion is significant for your data sizes. ## Package facts - License: This is free and unencumbered software released into the public domain. Anyone is free to copy, modify, publish, use, compile, sell, or distribute this software, either in source code form or as a… (full text in the JSON record) (permissive) - Python support: supports_current - Install friction: medium - Maintenance: dormant - Downloads: 177.2K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags LZW compression decompression, compress decompress bytes python, lossless data compression library, file compression utility, data compression algorithm, compression, lzw, data-encoding [View on SkillFed](https://skillfed.io/packages/ncompress) · [View on PyPI](https://pypi.org/project/ncompress/)