Skip to main content

Pydantic MQL

This library can parse and evaluate conditions using pydantic. The usage is similar to the MongoDB Query Language. But instead of filtering documents within a database collection you can use the library to filter arbitrary application data in memory.

Example Usage

Parsing

from pydantic_mql import Condition
test_json = '{"operator": "$eq", "field": "label", "value": "lab"}'
condition = Condition.model_validate_json(test_json)
print(condition)

Serializing

from pydantic_mql import Condition
condition = Condition(operator='$and', conditions=[
    Condition(operator='$eq', field='label', value='lab'),
    Condition(operator='$lte', field='rating', value=80)
])
print(condition.model_dump())

Condition Eval

test_data = {'rating': 60, 'label': 'lab'}
result = condition.eval(test_data)
print(result)

Metadata

Release files for pydantic-mql 0.1.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 pydantic-mql 0.1.0
File Size Uploaded Provenance Actions
pydantic-mql-0.1.0.tar.gz 4.1 kB Without provenance Details for pydantic-mql-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pydantic-mql 0.1.0
File Interpreter ABI Platform Actions
pydantic_mql-0.1.0-py3-none-any.whl Python 3 none any Details for pydantic_mql-0.1.0-py3-none-any.whl

Total release size: 8.9 kB

Release files / pydantic-mql-0.1.0.tar.gz

Download URL pydantic-mql-0.1.0.tar.gz
Size 4.1 kB
Tags Source
SHA-256 checksum
How to use checksums
439a59216bf1818a4983fdb2a021280f1b1c17c7036f84c039266754ea37a0db
BLAKE2b-256 checksum
How to use checksums
8d821585b1186630530db3af8059930ad0d9835757d7eca6c07b2cb67a47983b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.4

Release files / pydantic_mql-0.1.0-py3-none-any.whl

Download URL pydantic_mql-0.1.0-py3-none-any.whl
Size 4.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0f5166543994241262cbedfabff3ce5acf043c72b093024c94c4b00cb0aed39f
BLAKE2b-256 checksum
How to use checksums
8fb98d5ecfe64a71b6f23de023fe7b00dca5127457e9031a5d4708f94ae24bc3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.4

Security for pydantic-mql 0.1.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.

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.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No 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