pyrazobill
High-performance, lossless log parsing and information-theoretic semantic accounting library for Python, powered by librazobill 1.0.0 C++20 core.
Highlights
- Lossless Invertibility: Guarantees $E = I + \Lambda$. Reconstruct raw logs byte-for-byte with $0$ bit-level mismatches (
reconstruct(record) == msgorreconstruct(formKey, ints, strs) == msg). - Extreme Speed: Up to 69.4 Million logs/second across 12 hardware cores in C++ (5.6× to 283.7× faster than Drain3), and 515k – 737k+ logs/second in Python.
- Sub-Microsecond Latency: Median latency $0.1,\mu\text{s} - 0.8,\mu\text{s}$, $p_{99}$ tail latency $< 5.7,\mu\text{s}$ (up to 151× lower tail latency than Drain).
- GIL-Free Multi-Threading:
decomposeBatch()andparseBatch()release CPython's Global Interpreter Lock (GIL) to saturate all hardware threads. - Direct Columnar Decomposition:
decompose()anddecomposeBatch()return lightweight(formKey, ints, strs)tuples ready for instant ingestion into Arrow, DuckDB, or Polars. - Native SQL Engine Interop: Direct integration with DuckDB and ClickHouse chDB for analytical queries and 45%+ storage compaction.
- Zero-Underscore Naming: Clean, modern developer ergonomics (
parse,parseBatch,decompose,decomposeBatch,auditParallel,formKey,reconstruct).
┌────────────────────────────────────────────────────────────────────────────────────────┐
│ CPYTHON RAII LIFETIME & BUFFER OWNERSHIP ARCHITECTURE │
└────────────────────────────────────────────────────────────────────────────────────────┘
Python User Space
rec = pyrazobill.parse("User 1042 logged in")
│
▼
┌────────────────────────────────────────────────────────────────────────────┐
│ PySlotRecord (Native C++ Extension Wrapper) │
│ ┌────────────────────────────────────────────────────────────────────────┐ │
│ │ msgBuffer: std::shared_ptr<std::string> │ │
│ │ (Takes full heap ownership of raw string bytes; safe from Python GC) │ │
│ ├────────────────────────────────────────────────────────────────────────┤ │
│ │ slots.strs: std::vector<std::string_view> │ │
│ │ (Zero-copy slices point safely into msgBuffer; zero dangling pointers) │ │
│ ├────────────────────────────────────────────────────────────────────────┤ │
│ │ slots.ints: std::vector<int64_t> │ │
│ │ (Dense contiguous 64-bit integers ready for DuckDB / Arrow SIMD copy) │ │
│ └────────────────────────────────────────────────────────────────────────┘ │
└────────────────────────────────────────────────────────────────────────────┘
│
▼
rec.reconstruct() == "User 1042 logged in" (100% Exact Round-Trip)
Installation
From Source
git clone https://github.com/4t1a/razobill.git
cd razobill/lib/python
pip install .
Editable Development Mode
pip install -e .
Quickstart
import pyrazobill
# 1. Parse an individual log message
msg = "2026-10-07 14:02:11 [WARN] Connection to 10.0.0.1:5432 failed after 3 retries"
record = pyrazobill.parse(msg, pyrazobill.ScanMode.Semantic)
print("Form Key :", record.formKey)
# -> '2026-10-07 14:02:11 [WARN] Connection to {}:{} failed after {} retries'
print("Form Hash :", record.formKeyHash)
# -> 1284729104857201948 (64-bit uint)
print("Integers :", record.ints)
# -> [5432, 3]
print("Strings :", record.strs)
# -> ['10.0.0.1']
# 2. Losslessly reconstruct the exact original string
rebuilt = record.reconstruct()
assert rebuilt == msg
print("Lossless Reconstruct:", rebuilt)
# 3. High-Speed direct tuple decomposition (zero wrapper overhead)
formKey, ints, strs = pyrazobill.decompose(msg, pyrazobill.ScanMode.Semantic)
print("Decomposed :", formKey, ints, strs)
# 4. Symmetrical tuple reconstruction
assert pyrazobill.reconstruct(formKey, ints, strs) == msg
High-Speed Tuple Decomposition & Parallel Processing
For streaming pipelines into DuckDB, Polars, PyArrow, or AWS S3, pyrazobill.decomposeBatch() operates without creating Python wrapper objects and releases the GIL:
import concurrent.futures
import pyrazobill
lines = [
f"Worker {i%4} processed {100+i} items from 10.0.0.{i%250} port {5000+i}"
for i in range(100_000)
]
# 1. Single-threaded batch decomposition (515k+ logs/sec)
tuples = pyrazobill.decomposeBatch(lines[:1000], pyrazobill.ScanMode.Semantic)
formKey, ints, strs = tuples[0]
assert pyrazobill.reconstruct(formKey, ints, strs) == lines[0]
# 2. Multi-threaded scaling with ThreadPoolExecutor (737k+ logs/sec across 4 threads)
chunkSize = 25_000
chunks = [lines[i:i + chunkSize] for i in range(0, len(lines), chunkSize)]
with concurrent.futures.ThreadPoolExecutor(max_workers=4) as pool:
batchedResults = list(pool.map(lambda c: pyrazobill.decomposeBatch(c, pyrazobill.ScanMode.Semantic), chunks))
allTuples = [t for batch in batchedResults for t in batch]
print(f"Decomposed {len(allTuples):,} logs in parallel across 4 worker threads!")
High-Throughput Batch Processing
Process millions of logs using all hardware cores without GIL contention:
import pyrazobill
lines = [
"Worker 1 processed 100 items",
"Worker 2 processed 250 items",
"Worker 3 processed 80 items",
] * 100000
# Releases GIL and parallelizes across all available hardware threads
res = pyrazobill.auditParallel(
lines,
mode=pyrazobill.ScanMode.Semantic,
numThreads=0 # 0 detects hardware concurrency automatically
)
print(f"Throughput : {res.msgsPerSec:,.0f} msgs/sec ({res.mbPerSec:.2f} MB/sec)")
print(f"Elapsed Time : {res.elapsedSec:.3f} seconds")
print(f"Unique Forms : {res.uniqueFormsCount:,}")
print(f"Mismatches : {res.mismatches} (Zero data loss guarantee)")
DuckDB Extension Integration
pyrazobill bundles the native DuckDB compiled extension. Load and run directly in SQL:
import duckdb
import pyrazobill
con = duckdb.connect(config={"allow_unsigned_extensions": "true"})
# Dynamically locate and load the extension
extPath = pyrazobill.extensionPath().replace("\\", "/")
con.execute(f"LOAD '{extPath}';")
# Run vectorized scalar parsing in DuckDB using single-pass rbDecomposeSemantic
con.execute("""
CREATE TABLE parsedLogs AS
SELECT
d.form,
d.ints,
d.strs
FROM (
SELECT rbDecomposeSemantic(msg) AS d FROM rawTable
);
""")
# Reconstruct on the fly in analytical queries
con.execute("""
SELECT rbReconstruct(form, ints, strs) AS msg
FROM parsedLogs
LIMIT 10;
""")
Scanning Modes
| ScanMode | Description | Ideal Workloads |
|---|---|---|
ScanMode.Semantic |
Identifies semantic tokens (IPs, UUIDs, hashes, paths, numbers). (Recommended) | Production syslog, cloud microservices, K8s logs. |
ScanMode.Exact |
Strict lexical separation of integer/hex words and exact strings. | High-precision audit logs, cryptographic event trails. |
ScanMode.DigitOnly |
Fast single-character ASCII digit detection. | Telemetry counters, metrics streams. |
API Summary
# Lexical Parsing (Rich SlotRecord)
record = pyrazobill.parse(msg: str, mode: ScanMode = ScanMode.Semantic) -> SlotRecord
records = pyrazobill.parseBatch(msgs: list[str], mode: ScanMode = ScanMode.Semantic) -> list[SlotRecord]
# Direct Tuple Decomposition (Zero-Wrapper Overhead, GIL Released)
formKey, ints, strs = pyrazobill.decompose(msg: str, mode: ScanMode = ScanMode.Semantic) -> tuple[str, list[int], list[str]]
tuples = pyrazobill.decomposeBatch(msgs: list[str], mode: ScanMode = ScanMode.Semantic) -> list[tuple[str, list[int], list[str]]]
# Exact Lossless Reconstruction
original = pyrazobill.reconstruct(record: SlotRecord) -> str
original = pyrazobill.reconstruct(formKey: str, ints: list[int], strs: list[str]) -> str
# Templates & Hashing
key = pyrazobill.formKey(msg: str, mode: ScanMode = ScanMode.Semantic) -> str
tmpl = pyrazobill.templateOf(form: str) -> str
h = pyrazobill.hash64(text: str) -> int
# Information Theory & Theoretical Ledger (Atta 2026, DOI: 10.5281/zenodo.23287286)
H = pyrazobill.entropy(counts: list[float]) -> float
ledger = pyrazobill.computeLedger(cells: list[Cell], totalEvents: float, confidenceAlpha: float = 0.05) -> Ledger
decomp = pyrazobill.consequenceDecomposition(xy: list[XY], map: list[FormMeaning]) -> ConsequenceDecomposition
H_mm = pyrazobill.millerMadow(pluginEntropy: float, observedCategories: int, sampleSize: float) -> float
ci = pyrazobill.certifiedInterval(alphabetSize: int, sampleSize: float, confidenceAlpha: float = 0.05) -> tuple[float, float]
# Latitude Channel & Steganography (Theorem 4c)
cap = pyrazobill.channelAnalyzeCapacity(sequence: list[MeaningChoice]) -> ChannelCapacity
res = pyrazobill.channelEmbed(sequence: list[MeaningChoice], message: int, payloadBits: int, sharedKey: float, dither: float = 0.5) -> EmbedResult
dec = pyrazobill.channelDecode(sequence: list[MeaningChoice], observedForms: list[int], payloadBits: int, sharedKey: float) -> DecodeResult
# Parallel Multi-Core Audit
res = pyrazobill.auditParallel(lines: list[str], mode: ScanMode = ScanMode.Semantic, numThreads: int = 0) -> AuditResult
# System & Metadata
path = pyrazobill.extensionPath() -> str
ver = pyrazobill.version() -> str
abi = pyrazobill.abiVersion() -> int
info = pyrazobill.versionInfo() -> tuple[int, int, int]
Documentation & Deep Dive
For an exhaustive technical guide with production architecture recipes, see:
Academic Citation & Foundations
The information-theoretic ledger and channel capacity mechanisms implemented in pyrazobill originate from:
Atta, Moustafa Mahmoud (2026). Latitude and Doubt: An exact ledger of meaning in messages with measurements on the genetic code and on English.
Zenodo. DOI: 10.5281/zenodo.23287286 | Record: zenodo.org/records/23287286
@article{atta2026latitude,
author = {Atta, Moustafa Mahmoud},
title = {Latitude and Doubt: An exact ledger of meaning in messages with measurements on the genetic code and on English},
year = {2026},
journal = {Zenodo Preprint},
doi = {10.5281/zenodo.23287286},
url = {https://doi.org/10.5281/zenodo.23287286}
}
Metadata
Release files for pyrazobill 1.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| pyrazobill-1.0.1.tar.gz | 206.9 kB | Details |
Built distributions (wheels)
Total release size: 4.5 MB
Release files / pyrazobill-1.0.1.tar.gz
| Download URL | pyrazobill-1.0.1.tar.gz |
|---|---|
| Size | 206.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2e4d6cc27be980d9ec39a8aca410d2a6a749dae42195a238481fbc7b9320e3fa
|
|
BLAKE2b-256 checksum How to use checksums |
97d446cbcede14d3325ed5ac811134bc72b5e1fab1af0152c6ee62790db7877b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.15
|
Release files / pyrazobill-1.0.1-cp313-cp313-win_amd64.whl
| Download URL | pyrazobill-1.0.1-cp313-cp313-win_amd64.whl |
|---|---|
| Size | 218.8 kB |
| Tags | CPython 3.13 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
f9ea3095341cc4aee455cbfe9979da35fca1494744fc21f892b304be6424944d
|
|
BLAKE2b-256 checksum How to use checksums |
3c85ef64233ea6bb034c7aaef2bab2dd1c1a52c3d19a3bc042312ef252db7ac8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.15
|
Release files / pyrazobill-1.0.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | pyrazobill-1.0.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 615.9 kB |
| Tags | CPython 3.13 Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
ff04aa0398895b079e7037dc4eb62063e8eb3259d8757e1ed7d2355a6cd8c61d
|
|
BLAKE2b-256 checksum How to use checksums |
a98cf43ef930ea8d2712e7ee7399a7f45dc1f954254cd662f47df523523e904b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.15
|
Release files / pyrazobill-1.0.1-cp313-cp313-macosx_11_0_universal2.whl
| Download URL | pyrazobill-1.0.1-cp313-cp313-macosx_11_0_universal2.whl |
|---|---|
| Size | 20.0 kB |
| Tags | CPython 3.13 macOS 11.0+ universal2 (ARM64, x86-64) |
|
SHA-256 checksum How to use checksums |
9be9ce0e0e265d3ee29780a6313efed7a2ac5703c050107f380d568199e142bd
|
|
BLAKE2b-256 checksum How to use checksums |
e67b3a3509355d8bfddd067d47ed2193ea01892d2fa28ef681cc0eb1adb1e86e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.15
|
Release files / pyrazobill-1.0.1-cp312-cp312-win_amd64.whl
| Download URL | pyrazobill-1.0.1-cp312-cp312-win_amd64.whl |
|---|---|
| Size | 218.8 kB |
| Tags | CPython 3.12 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
e13e8608cc9fc11a09235dd5d1acfabcd6e545b500cdc3908ab8afccfd9e83ef
|
|
BLAKE2b-256 checksum How to use checksums |
3bafb56559bbd1774729d7ab514fb27e846021a25f3ab3ec9e250d22b8042cbb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.15
|
Release files / pyrazobill-1.0.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | pyrazobill-1.0.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 615.8 kB |
| Tags | CPython 3.12 Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
2e01c8f260b20b48b57890e36ab9917eaef30cc082421a56c8cc79c5788e6025
|
|
BLAKE2b-256 checksum How to use checksums |
22aa93e64f357d65e6f194ccd31959d147ff860c5b4fe85b075b34541ad07bcc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.15
|
Release files / pyrazobill-1.0.1-cp312-cp312-macosx_11_0_universal2.whl
| Download URL | pyrazobill-1.0.1-cp312-cp312-macosx_11_0_universal2.whl |
|---|---|
| Size | 20.0 kB |
| Tags | CPython 3.12 macOS 11.0+ universal2 (ARM64, x86-64) |
|
SHA-256 checksum How to use checksums |
3382839a6c960b997d451efc1b34cf0ec07f9b33c9dfffb03c0d240a55a44ed8
|
|
BLAKE2b-256 checksum How to use checksums |
c1d8619a8c6017832f878f0beaea4c96416ead5e31d3bdc040c543749c4e5f79
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.15
|
Release files / pyrazobill-1.0.1-cp311-cp311-win_amd64.whl
| Download URL | pyrazobill-1.0.1-cp311-cp311-win_amd64.whl |
|---|---|
| Size | 217.2 kB |
| Tags | CPython 3.11 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
c3ce674565eac45dd1e72a46c9691709c44abb962ef24050d58325679556e83a
|
|
BLAKE2b-256 checksum How to use checksums |
70b0e022a01f7dc0f47e4a8a64358e9ee165c542efef86ad32b865163a8d7a28
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.15
|
Release files / pyrazobill-1.0.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | pyrazobill-1.0.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 616.0 kB |
| Tags | CPython 3.11 Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
67d6bd23f5e8deb55dcad32041fa3db41cbdb0b8d990d55eca560a15cb2a1e23
|
|
BLAKE2b-256 checksum How to use checksums |
a179d82b9614671bd3ba720d7be123f27a0ae2ea265c7587f118d14368da3479
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.15
|
Release files / pyrazobill-1.0.1-cp311-cp311-macosx_11_0_universal2.whl
| Download URL | pyrazobill-1.0.1-cp311-cp311-macosx_11_0_universal2.whl |
|---|---|
| Size | 20.0 kB |
| Tags | CPython 3.11 macOS 11.0+ universal2 (ARM64, x86-64) |
|
SHA-256 checksum How to use checksums |
3f3508f137e00f32349ed8be6d5961563e07c51e421c3cf272b81f8befbc6b55
|
|
BLAKE2b-256 checksum How to use checksums |
5fc4b88b6a39c610e89e761fa2ecda403008310ae5a7285c7891b40b87677ef0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.15
|
Release files / pyrazobill-1.0.1-cp310-cp310-win_amd64.whl
| Download URL | pyrazobill-1.0.1-cp310-cp310-win_amd64.whl |
|---|---|
| Size | 216.3 kB |
| Tags | CPython 3.10 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
fb7dafc7860c3b4a610bef14aade747f9838e9cdf4d4763a9d3a666106aeaccf
|
|
BLAKE2b-256 checksum How to use checksums |
170231a5c6fa33cb67d113f1c821cf7d834aae6368982c31a48d0718090a8d06
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.15
|
Release files / pyrazobill-1.0.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | pyrazobill-1.0.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 615.5 kB |
| Tags | CPython 3.10 Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
ca75f0a0b77f306c11b0eba98a843d0bbe5602a3df107d7f82b9c0bb2aefba3b
|
|
BLAKE2b-256 checksum How to use checksums |
d8f32d5274b2e245b33bdfcfb6ab14b1a65c4d678f642b22f1519d79f0b14450
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.15
|
Release files / pyrazobill-1.0.1-cp310-cp310-macosx_11_0_universal2.whl
| Download URL | pyrazobill-1.0.1-cp310-cp310-macosx_11_0_universal2.whl |
|---|---|
| Size | 20.0 kB |
| Tags | CPython 3.10 macOS 11.0+ universal2 (ARM64, x86-64) |
|
SHA-256 checksum How to use checksums |
a8319ab86d91215730b0b04ecfb8a3900dd20f756876b7d154b2cc8fb48d15f6
|
|
BLAKE2b-256 checksum How to use checksums |
2c59eb9c835a9a50ed28fc781a53021b3bfeedaf887488281cb6a2b781157f91
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.15
|
Release files / pyrazobill-1.0.1-cp39-cp39-win_amd64.whl
| Download URL | pyrazobill-1.0.1-cp39-cp39-win_amd64.whl |
|---|---|
| Size | 216.2 kB |
| Tags | CPython 3.9 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
c1745f96556b86979cf5b5ae63afe62af15b98157ea676d4e5d9d153a08c7717
|
|
BLAKE2b-256 checksum How to use checksums |
3941d7b97b09e35da1b3e9efb6b04d89596a35f0fe95e1be43cfa8a9b399df97
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.15
|
Release files / pyrazobill-1.0.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | pyrazobill-1.0.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 615.8 kB |
| Tags | CPython 3.9 Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
84250835ad7af60354c36546422e373dcb010f5631556d70b80c12165f657c32
|
|
BLAKE2b-256 checksum How to use checksums |
8c5779a8dd4383a28bc8ac4b5cf4a0c04d4bd18d62f79e0ed898387f363df55f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.15
|
Release files / pyrazobill-1.0.1-cp39-cp39-macosx_11_0_universal2.whl
| Download URL | pyrazobill-1.0.1-cp39-cp39-macosx_11_0_universal2.whl |
|---|---|
| Size | 20.0 kB |
| Tags | CPython 3.9 macOS 11.0+ universal2 (ARM64, x86-64) |
|
SHA-256 checksum How to use checksums |
025b3f06d7fb4b6b1bb0dc53d731d9565a09f2f920167f99310b3d2428742e58
|
|
BLAKE2b-256 checksum How to use checksums |
bbd200ddab5189bd9c83548baa421fb7bcf2693c32c9aebb7a1848233626763b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.15
|