Skip to main content

Cereja

Python package PyPI version Downloads License: MIT

Cereja is a Python utility package for developers who want reusable helpers for files, paths, progress display, compression, hashing, text processing, data preparation, arrays, dates, and small system tasks.

The package is published on PyPI and supports Python 3.11 and newer.

Design principles

  • Zero runtime dependencies
  • Standard-library-first implementations
  • Small, reusable and composable APIs
  • Backward compatibility where practical
  • Educational implementations without hiding Python internals

Installation

python -m pip install cereja

Quick Start

import cereja as cj

path = cj.Path(".")
print(path.list_files())
from cereja.file import FileIO

file = FileIO.create("./example.txt", ["first line", "second line"])
file.add("third line")
file.save()

CLI

cereja --help
cereja tree .
cereja compress path/to/input
cereja decompress archive.cjz

Progress is enabled by default for CLI compression and decompression. Use --quiet for script-friendly output.

Cereja TUI

cereja ui --bracketed-paste
cereja ui --plain

On a terminal supporting bracketed paste, Cereja TUI provides explicit forms for System, Tree, Large files, Context, Archives and Download. Writes require exact-destination review and refuse replacement. See the Cereja TUI guide for supported limits, Windows-only directory extraction, terminal requirements and remaining human acceptance. Plain mode prints a reference and reads no input.

Embed with from cereja.tui import TUI. The former from cereja.ledger.app import Ledger remains an alias of the same class.

Large files by metadata

Find the largest regular files under an explicit root without reading content:

cereja large-files path/to/data --min-size-bytes 1048576 --max-results 20 --format json

Hidden and binary files are included, with no repository filters or link traversal. The Python API is cereja.system.file_sizes.find_large_files. See file sizes for partial-scan reporting, limits and reproducible benchmarks.

Search for all whitespace-separated terms in UTF-8 text under one or more explicit roots:

cereja context search --root docs --query "context search" --extension md
cereja context search --root docs --root cereja --query "Path FileIO" --format json

Inventory text files without returning their content:

cereja context list --root docs --max-results 20

Use --max-file-bytes, --max-results, --max-snippets, and --max-snippet-chars to bound search output. Searched source files are opened read-only and are never modified. The commands decode only UTF-8 text, skip binary files, and do not follow symbolic links.

The persistent cache is opt-in. When --cache is enabled, Cereja writes a global per-user cache outside the searched roots. Use --cache to populate or reuse it and --refresh-cache with --cache to force file content to be reprocessed:

cereja context search --root docs --query "context search" --cache
cereja context search --root docs --query "context search" --cache --refresh-cache

Inspect cache metadata or clear the context-cache namespace with:

cereja context cache info --format json
cereja context cache clear

If the optional cache is unavailable, context search emits a ContextCacheWarning and continues with a direct filesystem search.

Development

git clone https://github.com/cereja-project/cereja.git
cd cereja
python -m pip install -e .
python -m unittest discover -s tests -v

Run the syntax/undefined-name lint used by CI:

flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics

Documentation

Citation

If you use Cereja in academic work, please cite it. GitHub uses CITATION.cff for the "Cite this repository" button, and a BibTeX entry is available in CITATION.bib.

License

Cereja is distributed under the MIT License. See LICENSE for details.

Metadata

Release files for cereja 2.4.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for cereja 2.4.0
File Size Uploaded Provenance Actions
cereja-2.4.0.tar.gz 1.1 MB With provenance Details for cereja-2.4.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for cereja 2.4.0
File Interpreter ABI Platform Actions
cereja-2.4.0-py3-none-any.whl Python 3 none any Details for cereja-2.4.0-py3-none-any.whl

Total release size: 1.6 MB

Release files / cereja-2.4.0.tar.gz

Download URL cereja-2.4.0.tar.gz
Size 1.1 MB
Tags Source
SHA-256 checksum
How to use checksums
b73b4ecad320d1a4a672b7135111ef9ec0f46b5500495b121afc0d29e35fb7bc
BLAKE2b-256 checksum
How to use checksums
6dbb9ae648b30308247dd82dac457512c24d960b255eb6c1c3430ba1e97046b9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 28, 2026.

Transparency log

Release files / cereja-2.4.0-py3-none-any.whl

Download URL cereja-2.4.0-py3-none-any.whl
Size 482.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
13d42a003b02e01ea141fbf248e25b8df99b948cbd2c6779b92e750384c8d78b
BLAKE2b-256 checksum
How to use checksums
a68a23ee58892eaaf9735341c958d3a988e325af7969c7a2956ce912c5d750f6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 28, 2026.

Transparency log

Security for cereja 2.4.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for cereja-2.4.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 28, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

2.4.0 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page