ncompress
LZW compression and decompression
Decision gist · record as of 2026-08-14
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.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Python 3.8 or later.
- 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 · maintenance · safety
permissive license (permissive) — 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.
last release 2024-01-30 (927 days) · last repo commit 2024-10-21 · 4 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 177,236 downloads/mo, #10,218 on PyPI
Alternatives
Verify before relying
pip install ncompress
from ncompress import compress, decompress
original = b'hello world'
compressed = compress(original)
decompressed = decompress(compressed)- 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.
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 on this page. Verify before relying on it.
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
ncompress on PyPI
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.
Requires Python 3.8 or later.
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)
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 | permissive license permissive |
| Python support | Supports the current Python release >=3.8 |
| Install friction | Medium. Platform-specific wheel |
| Runtime dependencies | None |
| Maintenance | Dormant 927 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 177,236 / month, #10,218 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | License :: OSI Approved :: The Unlicense (Unlicense)Operating System :: OS IndependentProgramming Language :: Python :: 3 |
Evidence: ncompress-1.0.2-cp310-cp310-macosx_10_14_universal2.whl; ncompress-1.0.2-cp310-cp310-macosx_10_14_x86_64.whl; ncompress-1.0.2-cp310-cp310-macosx_11_0_arm64.whl; ncompress-1.0.2-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl; ncompress-1.0.2-cp310-cp310-manylinux_2_17_i686.manylinux2014_i686.whl; ncompress-1.0.2-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl; ncompress-1.0.2-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl; ncompress-1.0.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl; ncompress-1.0.2-cp310-cp310-musllinux_1_1_aarch64.whl; ncompress-1.0.2-cp310-cp310-musllinux_1_1_i686.whl; ncompress-1.0.2-cp310-cp310-musllinux_1_1_ppc64le.whl; ncompress-1.0.2-cp310-cp310-musllinux_1_1_s390x.whl; ncompress-1.0.2-cp310-cp310-musllinux_1_1_x86_64.whl; ncompress-1.0.2-cp310-cp310-win32.whl; ncompress-1.0.2-cp310-cp310-win_amd64.whl; ncompress-1.0.2-cp310-cp310-win_arm64.whl; ncompress-1.0.2-cp311-cp311-macosx_10_14_universal2.whl; ncompress-1.0.2-cp311-cp311-macosx_10_14_x86_64.whl; ncompress-1.0.2-cp311-cp311-macosx_11_0_arm64.whl; ncompress-1.0.2-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “LZW compression decompression”
- ncompressProvides LZW compression and decompression functions that accept…
- unlzw3Decompresses .Z files (Unix compress format) using pure Python,…
- xpress8xpress8 provides Python bindings to Microsoft's Xpress8 compression…
Give your agent the search over MCP, or paste the wish link into any chat.
More Utilities packages
Converts domain names between Unicode and ASCII-compatible encoding (Punycode) according to IDNA 2008 and Unicode Technical Standard 46, with security validation and broader script coverage than the standard library.
Install it if you work with internationalized domain names, need to validate domains, or use HTTP clients that depend on it transitively.
Detects and normalizes text encoding from unknown or ambiguous sources, supporting all IANA character sets that Python's core library provides codecs for, with the ability to register custom codecs.
Setuptools is a Python build backend and package management tool that handles building, distributing, and installing Python packages, including support for C/C++ extension modules.
Pluggy provides a plugin system that lets you define hook specifications and register implementations to be called in sequence, enabling extensible Python applications without tight coupling.
Install it if you're building an extensible application or framework.
Pygments is a syntax highlighter that colorizes source code and text in over 500 languages and formats, outputting to HTML, LaTeX, RTF, SVG, images, or ANSI terminal sequences.
Install it if you need to display or transform source code.
Six provides utility functions to write Python code that runs on both Python 2.7 and Python 3.3+, smoothing over language differences between the two versions.
See also python-neo-lzf · unlzw3 · pcodec · xpress9 · lzstring · compressed-rtf · pynwb · python-lzf · lzfse · lzallright