Skip to content
forked from leetreveil/gengzip

python module for gzipping data using generators

Notifications You must be signed in to change notification settings

xalioth/gengzip

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gengzip

image

Python generators are cool. The compress() function returns a python generator with the gzipped data.

Installation

Install via pip:

$ pip install gengzip

Usage

input = [b'123', b'45']
# compress() returns a python generator object
# compresslevel defaults to 6
for compressed in gengzip.compress(input, compresslevel=6):
    print compressed

gzip data and write to file:

input = [b'123', b'45']
with open('output.gz', 'w') as f:
    for compressed in gengzip.compress(input):
        f.write(compressed)

Licence

MIT

About

python module for gzipping data using generators

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 100.0%