Compress: shrink verbose context (JSON/logs/prose) 60-90% — reversibly. compress() returns a handle; expand() restores the original.
Project description
cendor-squeeze
Shrink verbose context — JSON, logs, code, prose — without throwing anything away. Compression returns a handle; the original is always restorable. Content-aware: each type gets a purpose-built, deterministic compressor — no LLM, no model download, byte-reproducible.
Up to ~99% smaller on repetition-heavy logs (~50% on structured data), 100% reversible — zero dependencies, deterministic output.
·
pip install cendor-squeeze
from cendor.squeeze import compress
small, handle = compress(huge_json, kind="auto") # detect + route
small, handle = compress(source_code, kind="code", fidelity="aggressive")
small, handle = compress(logs, kind="logs", target_tokens=400) # compress to a budget
original = handle.expand() # restore, byte-for-byte
Highlights
- Four purpose-built compressors — JSON (minify + drop nulls; budget-shrink drops keys/elements structurally, staying valid JSON), logs (normalize timestamps/UUIDs/IPs/hex/integers + dedup repeats into
(×N), chronological), code (strip comments — string-aware, so a//or#inside a literal stays put; keeps preprocessor & shebang), prose (extractive, abbreviation-aware sentence splitting).detect()auto-routes. - Compress to a budget —
target_tokensis never exceeded;fidelity="lossless" | "balanced" | "aggressive". No LLM, no download, byte-reproducible. - 100% reversible — a content-addressed store (deduped by hash) keeps every original;
handle.expand()restores it byte-for-byte no matter how hard you squeeze. - Survives restarts —
handle.to_dict()/Handle.from_dict()next to a durablesqueeze.store.SQLiteStore; or a boundedMemoryStore(max_items=…)viause_store(...). - The deterministic default, swappable — wired through core's
Compressorprotocol (not a hard import), socontextkit.use_compressor(...)can replace it globally with any backend (even a heavier ML compressor). squeeze stays the pick for reproducible, offline, audit-friendly output.
Inbound — usually contextkit calls it for you (Block(evict="compress")). Ratios are content-dependent (logs compress most, structured JSON least) — see the benchmarks.
See docs/squeeze.md · CHANGELOG. Part of the Cendor stack — github.com/cendorhq/Cendor. Powered by PowerAI Labs. Apache-2.0; provided "as is", without warranty — use at your own risk (LICENSE §7–8).
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
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
File details
Details for the file cendor_squeeze-1.0.0.tar.gz.
File metadata
- Download URL: cendor_squeeze-1.0.0.tar.gz
- Upload date:
- Size: 18.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3b83f48639b88efe62f5a10603133772e7f72ddbb297abd5940b9d5791485c15
|
|
| MD5 |
dd59ba28320b3cbbc096315118e4e9d2
|
|
| BLAKE2b-256 |
d9ad6f3fc9c5f9de82e9a77ebaff5df9bf37f262109a330b3acf152c80374d1d
|
Provenance
The following attestation bundles were made for cendor_squeeze-1.0.0.tar.gz:
Publisher:
release.yml on cendorhq/Cendor
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
cendor_squeeze-1.0.0.tar.gz -
Subject digest:
3b83f48639b88efe62f5a10603133772e7f72ddbb297abd5940b9d5791485c15 - Sigstore transparency entry: 2063255222
- Sigstore integration time:
-
Permalink:
cendorhq/Cendor@1733d9d073230ac9448221f660fce4ab07a42c33 -
Branch / Tag:
refs/tags/squeeze-v1.0.0 - Owner: https://github.com/cendorhq
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@1733d9d073230ac9448221f660fce4ab07a42c33 -
Trigger Event:
push
-
Statement type:
File details
Details for the file cendor_squeeze-1.0.0-py3-none-any.whl.
File metadata
- Download URL: cendor_squeeze-1.0.0-py3-none-any.whl
- Upload date:
- Size: 15.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c81a1f02acd825c62f8469cf57c3f102a56c7221760c7740d118b315fbdbbc64
|
|
| MD5 |
24a83a6c2026625928a031e6d9f24e8d
|
|
| BLAKE2b-256 |
b458a5b2381a212ad15308ca53c6165e57de303a672fb6bddd789ad1d5c4949a
|
Provenance
The following attestation bundles were made for cendor_squeeze-1.0.0-py3-none-any.whl:
Publisher:
release.yml on cendorhq/Cendor
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
cendor_squeeze-1.0.0-py3-none-any.whl -
Subject digest:
c81a1f02acd825c62f8469cf57c3f102a56c7221760c7740d118b315fbdbbc64 - Sigstore transparency entry: 2063255310
- Sigstore integration time:
-
Permalink:
cendorhq/Cendor@1733d9d073230ac9448221f660fce4ab07a42c33 -
Branch / Tag:
refs/tags/squeeze-v1.0.0 - Owner: https://github.com/cendorhq
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@1733d9d073230ac9448221f660fce4ab07a42c33 -
Trigger Event:
push
-
Statement type: