lzstring
lz-string for python
What it is and what it does
lzstring is a Python port of the LZ-String JavaScript compression library. It provides methods to compress and decompress text into various formats, including Base64, making it useful for reducing payload size when transmitting or storing text data. The package has no runtime dependencies and works with both Python 2 and 3, though its classifiers reflect only legacy Python versions (2.6–3.3).
The library is dormant: the latest release was June 2018, and while the repository shows a commit from October 2023, there has been no active development or maintenance for years. It remains available and functional for basic compression tasks, but the lack of recent updates means compatibility with modern Python versions is uncertain.
Use it for:
- Compress Unicode text including non-ASCII characters for storage or transmission over bandwidth-constrained channels
- Interoperate with JavaScript applications using the original LZ-String library by compressing and decompressing shared data
- Reduce payload size in web APIs or data serialization where standard compression formats are not suitable
- Archive or deduplicate text-heavy datasets where LZ-String's algorithm offers acceptable compression ratios
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Compresses and decompresses text using the LZ-String algorithm, supporting multiple output formats including Base64 encoding.
No. The package is dormant (last release June 2018), classifiers claim only Python 2.6–3.3 support, and actual compatibility with modern Python is unverified. High install friction from source distribution adds friction. While MIT-licensed and free of known vulnerabilities, the lack of maintenance and uncertain modern-Python support make it a poor choice for new projects. Consider only if you must interoperate with legacy systems already using this library.
Install
lzstring on PyPI
pip
pip install lzstringuv
uv add lzstringpoetry
poetry add lzstringInstalling lzstring
Before you install
High install friction from source distribution. Dormant maintenance: last release June 2018, last commit October 2023, with only 12 repository stars. Classifiers indicate Alpha status and support for Python 2.6–3.3.
License in practice
MIT license (permissive) imposes no restrictions on use, modification, or distribution in proprietary or open-source projects.
Quickstart
pip install lzstring
import lzstring
x = lzstring.LZString()
compressed = x.compressToBase64(u'你好')
x.decompressFromBase64(compressed)
Verify before relying
- Whether the package actually works on Python versions beyond 3.3 despite modern Python support being unspecified
- Whether the source distribution requires compilation or has undocumented system dependencies
- Current maintenance status and willingness to accept pull requests or address issues
Package facts
| License | not declared (permissive) |
| Python support | not specified |
| Install friction | high — source build required |
| Runtime dependencies | none |
| Maintenance | dormant — 2,996 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 353,830/month — #7,299 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: lzstring-1.0.4.tar.gz
Keywords: lz-string
Tags
More Utilities packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
charset-normalizerDetects and normalizes text encoding from…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
pluggyPluggy provides a plugin system that lets you…
permissive · top 100 on PyPI
PygmentsPygments is a syntax highlighter that colorizes…
permissive · top 100 on PyPI
sixSix provides utility functions to write Python…
permissive · top 100 on PyPI
python-neo-lzfProvides fast compression and decompression of…
permissive · top 15,000 on PyPI
compressed-rtfCompresses and decompresses Rich Text Format…
permissive · top 5,000 on PyPI
ncompressProvides LZW compression and decompression…
permissive · top 15,000 on PyPI
python-lzfProvides Python bindings to the liblzf…
permissive · top 15,000 on PyPI
unlzw3Decompresses .Z files (Unix compress format)…
permissive · top 15,000 on PyPI
listcrunchCompresses sequences of repeated values into a…
permissive · top 15,000 on PyPI
pyzstdProvides Python bindings to the Zstandard…
permissive · top 5,000 on PyPI
Flask-CompressFlask-Compress automatically compresses Flask…
permissive · top 5,000 on PyPI
inflate64Provides Deflater and Inflater classes to…
copyleft · top 5,000 on PyPI
xpress9Xpress9 is a Python wrapper for Microsoft's…
permissive · top 15,000 on PyPI