Compress stream by GZIP on the fly.
Project description
gzip-stream is a super-tiny library that will help you compress by GZIP on-the-fly.
GZIPCompressedStream class instance acting like an any other stream (in fact, GZIPCompressedStream inherits io.RawIOBase), but wraps another stream and compress it on-the-fly.
from gzip_stream import GZIPCompressedStream
from my_upload_lib import MyUploadClient
upload_client = MyUploadClient()
with open('my_very_big_1tb_file.txt') as file_to_upload:
compressed_stream = GZIPCompressedStream(
file_to_upload,
compression_level=7
)
upload_client.upload_fileobj(compressed_stream)
GZIPCompressedStream does not read entire stream, but instead read it by chunks, until compressed output size will not satisfy read size.
Module works on Python ~= 3.5.
Installation
pip install gzip-stream
License
Public Domain: CC0 1.0 Universal.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
gzip-stream-1.0.0.tar.gz
(2.7 kB
view details)
File details
Details for the file gzip-stream-1.0.0.tar.gz
.
File metadata
- Download URL: gzip-stream-1.0.0.tar.gz
- Upload date:
- Size: 2.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 10537ba40d8ea94e6780d13bd89235d537a3d725d4c9d2dcf34993b15fa3dfe3 |
|
MD5 | 0e1083412f4a394ab3e10741cfaa82d6 |
|
BLAKE2b-256 | 3ef2fef1be541429c6f944889dd8713dd0be8ce350f29cea2bc26378996e825d |