File: README.txt

package info (click to toggle)
python-bitarray 3.6.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,288 kB
  • sloc: python: 11,456; ansic: 7,657; makefile: 73; sh: 6
file content (35 lines) | stat: -rw-r--r-- 800 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
Ilan Schnell
April, 2022


This is a simple implemention of inflate based on Mark Adler's excellent Puff:
https://github.com/madler/zlib/blob/master/contrib/puff/puff.c

While writing this, I also found useful:
https://github.com/nayuki/Simple-DEFLATE-decompressor/tree/master/python


I wrote this to better understand the DEFLATE format, and also to give
an example on how to write a Python C extension which makes use of bitarray
on the C-level.


To try it out (you need to have bitarray installed into your Python 3):

    $ make test
    ...
    $ python gunzip.py <file.gz> <output>
    ...


Files:

_puff.c
  - an object State (similar to the struct state in puff.c)

puff.py
  - a class Puff which inherits from State

gunzip.py
  - a class GunZip which inherits from Puff
  - a simple CLI