Skip to main content

panini-py — Python port of Panini

Deterministic, privacy-preserving parser for Indian bank narrations. This package is the Python port of @paniniapi/rules-engine and shares the same grammar JSONs and conformance corpus — both runtimes are tested against the identical fixture set, so parity is enforced, not assumed.

Quick start

from panini import parse_narration

txn = parse_narration("UPI/20261015/DR/826384910234/SWIGGY@okaxis/Cooking/")
# {
#   "channel": "UPI", "type": "DEBIT", "ref_no": "826384910234",
#   "merchant": "Swiggy", "vpa": "okaxis", "vpa_app": "Google Pay",
#   "vpa_bank": "Axis Bank", "category": "Food & Dining", ...
# }

Where the grammars live

The grammar JSONs ship inside the wheel under panini/rules/ — a pip install works standalone with no repo checkout. In a development checkout the engine falls back to packages/rules-engine/rules/; the bundled copy is kept byte-identical and drift is enforced by tests/test_bundled_rules.py. Resolution order:

  1. PANINI_RULES_DIR env var or rules_dir=Path(...) argument
  2. bundled panini/rules/ package data
  3. repo path (packages/rules-engine/rules/) for dev checkouts

Conformance

python3 -m unittest discover tests

runs every fixture in packages/rules-engine/rules/corpus/*.json through the Python engine and asserts the same expect fields the TypeScript corpus gate checks — channel, type, ref_no, counterparty, vpa, merchant/vpa/IFSC enrichment, is_salary, date, category.

Status

Alpha scaffold: narration pipeline (tokenizer → grammar match → normalize → enrich) is at full corpus parity (76/76) and grammar data is bundled for PyPI distribution. SMS media routing and normalizePayload land next.

Metadata

Release files for panini-parser 0.2.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 panini-parser 0.2.0
File Size Uploaded
panini_parser-0.2.0.tar.gz 34.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for panini-parser 0.2.0
File Interpreter ABI Platform
panini_parser-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 76.5 kB

Release files / panini_parser-0.2.0.tar.gz

Download URL panini_parser-0.2.0.tar.gz
Size 34.3 kB
Tags Source
SHA-256 checksum
How to use checksums
e69a11cdd8e57e50df30acd55d29a46cea2405dd63ef7a2abe494a14a7f01082
BLAKE2b-256 checksum
How to use checksums
7fcedcda142d668f3e6a7059e41c0b71c0f1943b4c161960c1809c2aaeedb907
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.6

Release files / panini_parser-0.2.0-py3-none-any.whl

Download URL panini_parser-0.2.0-py3-none-any.whl
Size 42.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
98734be800646c7cd5331131c579b3ec01c2a9d7086d4834917575b7afd1046a
BLAKE2b-256 checksum
How to use checksums
26858ac18baf7172cbd0fc426041573474c2f416447db3394f3da846748184d0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.6

Release history Release notifications | RSS feed

0.3.0

2 release files

This release

0.2.0 This release

2 release files

0.1.0

2 release files

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