Utilities to work with gzip compressed base64 content.
Project description
JZip
Utilities to work with gzip-compressed base64 content.
Features
- Decode
gzip(base64)to raw bytes - Decode
gzip(base64)to plain text - Convert
gzip(base64)to plain base64 - Compress any file (text or binary) into
gzip(base64) - Restore original files from
gzip(base64)safely - CLI support:
jzip encodeandjzip decode - Strict validation with clear errors for invalid base64/gzip input
Installation
pip install jzip
Usage
Compress file to gzip base64
from jzip import compress_file_to_base64
gzip_b64 = compress_file_to_base64("sample.pdf")
print(gzip_b64)
Restore original file from gzip base64
from jzip import write_to_original_file
write_to_original_file(gzip_b64, "sample.pdf")
Decode gzip base64 to bytes/text/plain base64
from jzip import (
decode_gzip_base64_to_bytes,
decode_gzip_base64_to_text,
decode_gzip_base64_to_plain_base64,
)
raw_bytes = decode_gzip_base64_to_bytes(gzip_b64)
text = decode_gzip_base64_to_text(gzip_b64, encoding="utf-8")
plain_b64 = decode_gzip_base64_to_plain_base64(gzip_b64)
CLI
Encode a file
jzip encode ./sample.pdf > sample.gzip.b64
Decode from an argument
jzip decode ./restored.pdf --input "$(cat sample.gzip.b64)"
Decode from stdin
cat sample.gzip.b64 | jzip decode ./restored.pdf
Decode from a file containing base64
jzip decode ./restored.pdf --input-file ./sample.gzip.b64
Automated Release
Pushes to main trigger:
- tests
- package build
- publish to PyPI (
skip-existingenabled)
Configure GitHub secret PYPI_API_TOKEN in repository settings for publishing.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
jzip-1.1.0.tar.gz
(6.1 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
jzip-1.1.0-py3-none-any.whl
(6.3 kB
view details)
File details
Details for the file jzip-1.1.0.tar.gz.
File metadata
- Download URL: jzip-1.1.0.tar.gz
- Upload date:
- Size: 6.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3ed0d63a2ef3dfd20750742eef820cf3201dd3655a0cb34d4661d4f201f8a2a5
|
|
| MD5 |
8c76386c4f1526b881acc1769ddb7680
|
|
| BLAKE2b-256 |
83fb7586a38a1ca02fbd0fee69a6392a07ab1e4856604acd484b8fd9822c9b0c
|
File details
Details for the file jzip-1.1.0-py3-none-any.whl.
File metadata
- Download URL: jzip-1.1.0-py3-none-any.whl
- Upload date:
- Size: 6.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c54be144356e8a3135542811078315e017d74341df65abf33374cccdb7820829
|
|
| MD5 |
4ff734b58dcff9bcac304aa45a671b15
|
|
| BLAKE2b-256 |
69affb58a0a436f2ab3fb626d4839ae4716125c1c9f0795bfc3e28a43928792c
|