| CARVIEW |
Select Language
HTTP/2 200
date: Mon, 29 Dec 2025 15:16:16 GMT
content-type: text/html; charset=utf-8
vary: X-PJAX, X-PJAX-Container, Turbo-Visit, Turbo-Frame, X-Requested-With,Accept-Encoding, Accept, X-Requested-With
etag: W/"353d04fc9fa862c9af8e59d37e9f558b"
cache-control: max-age=0, private, must-revalidate
strict-transport-security: max-age=31536000; includeSubdomains; preload
x-frame-options: deny
x-content-type-options: nosniff
x-xss-protection: 0
referrer-policy: no-referrer-when-downgrade
content-security-policy: default-src 'none'; base-uri 'self'; child-src github.githubassets.com github.com/assets-cdn/worker/ github.com/assets/ gist.github.com/assets-cdn/worker/; connect-src 'self' uploads.github.com www.githubstatus.com collector.github.com raw.githubusercontent.com api.github.com github-cloud.s3.amazonaws.com github-production-repository-file-5c1aeb.s3.amazonaws.com github-production-upload-manifest-file-7fdce7.s3.amazonaws.com github-production-user-asset-6210df.s3.amazonaws.com *.rel.tunnels.api.visualstudio.com wss://*.rel.tunnels.api.visualstudio.com github.githubassets.com objects-origin.githubusercontent.com copilot-proxy.githubusercontent.com proxy.individual.githubcopilot.com proxy.business.githubcopilot.com proxy.enterprise.githubcopilot.com *.actions.githubusercontent.com wss://*.actions.githubusercontent.com productionresultssa0.blob.core.windows.net/ productionresultssa1.blob.core.windows.net/ productionresultssa2.blob.core.windows.net/ productionresultssa3.blob.core.windows.net/ productionresultssa4.blob.core.windows.net/ productionresultssa5.blob.core.windows.net/ productionresultssa6.blob.core.windows.net/ productionresultssa7.blob.core.windows.net/ productionresultssa8.blob.core.windows.net/ productionresultssa9.blob.core.windows.net/ productionresultssa10.blob.core.windows.net/ productionresultssa11.blob.core.windows.net/ productionresultssa12.blob.core.windows.net/ productionresultssa13.blob.core.windows.net/ productionresultssa14.blob.core.windows.net/ productionresultssa15.blob.core.windows.net/ productionresultssa16.blob.core.windows.net/ productionresultssa17.blob.core.windows.net/ productionresultssa18.blob.core.windows.net/ productionresultssa19.blob.core.windows.net/ github-production-repository-image-32fea6.s3.amazonaws.com github-production-release-asset-2e65be.s3.amazonaws.com insights.github.com wss://alive.github.com wss://alive-staging.github.com api.githubcopilot.com api.individual.githubcopilot.com api.business.githubcopilot.com api.enterprise.githubcopilot.com; font-src github.githubassets.com; form-action 'self' github.com gist.github.com copilot-workspace.githubnext.com objects-origin.githubusercontent.com; frame-ancestors 'none'; frame-src viewscreen.githubusercontent.com notebooks.githubusercontent.com; img-src 'self' data: blob: github.githubassets.com media.githubusercontent.com camo.githubusercontent.com identicons.github.com avatars.githubusercontent.com private-avatars.githubusercontent.com github-cloud.s3.amazonaws.com objects.githubusercontent.com release-assets.githubusercontent.com secured-user-images.githubusercontent.com/ user-images.githubusercontent.com/ private-user-images.githubusercontent.com opengraph.githubassets.com marketplace-screenshots.githubusercontent.com/ copilotprodattachments.blob.core.windows.net/github-production-copilot-attachments/ github-production-user-asset-6210df.s3.amazonaws.com customer-stories-feed.github.com spotlights-feed.github.com objects-origin.githubusercontent.com *.githubusercontent.com; manifest-src 'self'; media-src github.com user-images.githubusercontent.com/ secured-user-images.githubusercontent.com/ private-user-images.githubusercontent.com github-production-user-asset-6210df.s3.amazonaws.com gist.github.com github.githubassets.com; script-src github.githubassets.com; style-src 'unsafe-inline' github.githubassets.com; upgrade-insecure-requests; worker-src github.githubassets.com github.com/assets-cdn/worker/ github.com/assets/ gist.github.com/assets-cdn/worker/
server: github.com
content-encoding: gzip
accept-ranges: bytes
set-cookie: _gh_sess=2S5BgOuTc7kXyITtWkf%2BZKSSh9zyDdQVKlmxigthBhTpL65pTMxJnNKqe01piRYu3j6H4NJPb5bQDi2UUt8Qc2l6D06j2LZdxofuh1toR57cbSFwCFV5rZw6rVM9ezZ9hcfIa1rzjP1WK68uv5xYzxpUSwmfS2SQ7Y5WvNO3EWCLbsFmqeaAqHJ0FT7tsFKFFJTnmzHHKTsWc3dhRawipNAc7tsZF58gjh1s2MUXa1dpEP%2FO%2FSWNzPtL2tvD8Eh5bHsJcQgxZq0zvqg%2Bj9O2yQ%3D%3D--CLYVexN900sw3wdV--gA8b81GAZdvRvO5qzLkzLA%3D%3D; Path=/; HttpOnly; Secure; SameSite=Lax
set-cookie: _octo=GH1.1.1090976807.1767021375; Path=/; Domain=github.com; Expires=Tue, 29 Dec 2026 15:16:15 GMT; Secure; SameSite=Lax
set-cookie: logged_in=no; Path=/; Domain=github.com; Expires=Tue, 29 Dec 2026 15:16:15 GMT; HttpOnly; Secure; SameSite=Lax
x-github-request-id: DA2C:211B61:63A1FB6:774F0D9:69529B3F
GitHub - joeatwork/python-lzw: LZW compression in pure python
Skip to content
Navigation Menu
{{ message }}
-
Notifications
You must be signed in to change notification settings - Fork 17
LZW compression in pure python
License
joeatwork/python-lzw
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
This is the README file for lzw, small, low level, pure python module
for simple, stream-friendly data compression, built around iterators.
Please see the accompanying LICENSE.txt file for license terms.
lzw currently requires python 2.7 or python 3.4 to run.
Before going on, potential users are advised to take a look at the
gzip, zlib, bz2, zipfile, and tarfile modules available in the python
standard library, which are dynamite-fast, mature, well supported, and
generally awesome.
Seriously, check them out! You've already got them!
----
This software is in Pre-Alpha release, any bug reports (or even
stories about ways you use the software, or wish you could use the
software) are appreciated! Mail joerbowers@joe-bowers.com with your
info.
---
INSTALLING
you should be able to install this package with
python setup.py install
----
Ok, moving on.
The easiest way to use lzw is probably something like this
>>> import lzw
>>>
>>> infile = lzw.readbytes("My Uncompressed File.txt")
>>> compressed = lzw.compress(infile)
>>> lzw.writebytes("My Compressed File.lzw", compressed)
>>>
>>> # Then later (or elsewhere)
>>> infile = lzw.readbytes("My Compressed File.lzw", compressed)
>>> uncompressed = lzw.decompress(infile)
>>> for bt in uncompressed:
>>> do_something_awesome_with_this_byte(bt)
>>>
See the module documentation for more details.
---
The underlying compression algorithm for this module is as expressed
in section 13 of the TIFF 6.0 specification, pages 58 to 62, available
at the time of this writing on-line at
https://partners.adobe.com/public/developer/en/tiff/TIFF6.pdf
Wherever possible, I've tried to adhere to the algorithm and
conventions that are described (in exhaustive and yet very readable
detail!) in that document, even when it gets a bit Tiff
specific. Where there are differences, they are likely bugs in this
code.
---
Current dev priorities:
- Hunt down some potential user applications, see why they're
potential rather than actual, and then get on that bus.
For now
- Keep things as simple and intelligible as possible
- Adhere as closely to the TIFF spec as is reasonable
- Keep memory use low for good use of the iterators
- Stay in pure python
- Faster would be nicer, though...
About
LZW compression in pure python
Resources
License
Stars
Watchers
Forks
Packages 0
No packages published
You can’t perform that action at this time.