skillfed

lzstring

lz-string for python

lzstring v1.0.4 353.8K downloads/30d#7,299 on PyPI12
Permissive license DORMANT released

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 lzstring

uv

uv add lzstring

poetry

poetry add lzstring

Installing 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

Development Status :: 3 - AlphaIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseNatural Language :: EnglishProgramming Language :: PythonProgramming Language :: Python :: 2Programming Language :: Python :: 2.6Programming Language :: Python :: 2.7Programming Language :: Python :: 3Programming Language :: Python :: 3.1Programming Language :: Python :: 3.2Programming Language :: Python :: 3.3

Tags

lz-string compression pythontext compression base64lzstring compress decompressjavascript lz-string portstring compression librarydata compression utility
compressionlegacy-maintenance

More Utilities packages