Skip to main content

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.

PyPI license · 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 budgettarget_tokens is 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 restartshandle.to_dict() / Handle.from_dict() next to a durable squeeze.store.SQLiteStore; or a bounded MemoryStore(max_items=…) via use_store(...).
  • The deterministic default, swappable — wired through core's Compressor protocol (not a hard import), so contextkit.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-libs. Powered by PowerAI Labs. Apache-2.0; provided "as is", without warranty — use at your own risk (LICENSE §7–8).

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cendor_squeeze-1.0.2.tar.gz (20.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cendor_squeeze-1.0.2-py3-none-any.whl (16.6 kB view details)

Uploaded Python 3

File details

Details for the file cendor_squeeze-1.0.2.tar.gz.

File metadata

  • Download URL: cendor_squeeze-1.0.2.tar.gz
  • Upload date:
  • Size: 20.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for cendor_squeeze-1.0.2.tar.gz
Algorithm Hash digest
SHA256 0301082b21c0be5aa58f16c02e35ebad2902bb1207d34cfb4be55f3589722276
MD5 99cfd4f5d114095c4661ea65c1be7d30
BLAKE2b-256 89d5971aa8fbaaae6ddb97658dd39ba12d4fe1aa05564cc9bb8e0d6c403791a4

See more details on using hashes here.

Provenance

The following attestation bundles were made for cendor_squeeze-1.0.2.tar.gz:

Publisher: release.yml on cendorhq/cendor-libs

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file cendor_squeeze-1.0.2-py3-none-any.whl.

File metadata

  • Download URL: cendor_squeeze-1.0.2-py3-none-any.whl
  • Upload date:
  • Size: 16.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for cendor_squeeze-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 2c4c5a57ec85e7d2a88bc46b43a7aaf363915f8bf1dfe431b68f8a1c69bc9afb
MD5 8e6bd58a54f282e7346460cb62eca28c
BLAKE2b-256 1308a10330f732835d827a28f2f556e5b778c2fb979e629adb5e6f100318ebb8

See more details on using hashes here.

Provenance

The following attestation bundles were made for cendor_squeeze-1.0.2-py3-none-any.whl:

Publisher: release.yml on cendorhq/cendor-libs

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

1.1.2

2 files

1.1.1

2 files

1.1.0

2 files

1.0.3

2 files

This release

1.0.2 This release

2 files

1.0.1

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page