Skip to main content

pyrulecc

Declarative record filtering — put the conditions in data instead of writing one if chain per dataset.

Install

pip install pyrulecc

Usage

from pyrulecc import filter_records, match_record

row = {"name": "alice", "age": 30, "org": {"code": "A1"}}

match_record(row, {"age": (">=", 18)})            # True
match_record(row, {"name": ("contains", "li")})   # True
match_record(row, {"org.code": "A1"})             # True  dotted path

rows = [{"n": 1}, {"n": 5}, {"n": 9}]
filter_records(rows, {"n": (">", 2)})            # [{'n': 5}, {'n': 9}]

Operators

eq, ne, gt, ge, lt, le, in, contains, startswith, endswith, regex.

A bare value means eq. Unknown operators raise ValueError instead of quietly matching nothing.

Missing fields

A rule on a field the record does not have never matches — filtering data with holes should not silently pass records through.

License

MIT

Metadata

Release files for pyrulecc 0.0.2

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

Source distribution (sdist)

Source distribution for pyrulecc 0.0.2
File Size Uploaded Provenance Actions
pyrulecc-0.0.2.tar.gz 3.5 kB Without provenance Details for pyrulecc-0.0.2.tar.gz

Built distribution (wheel)

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

Total release size: 7.3 kB

Release files / pyrulecc-0.0.2.tar.gz

Download URL pyrulecc-0.0.2.tar.gz
Size 3.5 kB
Tags Source
SHA-256 checksum
How to use checksums
8da8fe154fcb3436dc7d7edd813a39d6931f8742a94ce3c2bca7acec4e02a98a
BLAKE2b-256 checksum
How to use checksums
86eb5b4096efdb5d359f0f5a4a3d4b0c1af3c968532977d6490dd98d65d81db4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.10.11

Release files / pyrulecc-0.0.2-py3-none-any.whl

Download URL pyrulecc-0.0.2-py3-none-any.whl
Size 3.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e86961417d11f9350303bcd7d8d5f202d49c790f7badcda95b0829851d77acfd
BLAKE2b-256 checksum
How to use checksums
3c2cec35caf8af1978eac51998ba0c0f23125617eb22f0c289b12fa2b9e6dfb0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.10.11

Security for pyrulecc 0.0.2

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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.

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