Skip to main content

interdict

Python dictionary filter

Installation

pip install interdict

Examples

Default (inclusion False)

>>> from interdict import filter_obj
>>> obj = {'name': 'shane', 'job': {'salary': 1000000, 'role': 'master of universe'}}
>>> filter = {'name': True, 'job': {'role': True}}
>>> filter_obj(obj, filter)
{'name': 'shane', 'job': {'role': 'master of universe'}}

Inclusive (a.k.a. TMI)

>>> filter_obj(obj, filter, default=True)
{'name': 'shane', 'job': {'salary': 1000000, 'role': 'master of universe'}}

Inclusive with better filter

>>> filter = {'job': {'salary': False}}
>>> filter_obj(obj, filter, default=True)
{'name': 'shane', 'job': {'role': 'master of universe'}}

Stacked filters

>>> obj = {'name': 'shane', 'job': {'salary': 1000000, 'role': {'title': 'master of universe', 'reality': 'dumpster fire starter'}}}
>>> filter_1 = {'name': False}
>>> filter_2 = {'job': {'salary': False, 'role': {'reality': False}}}
>>> filter_obj(obj, [filter_1, filter_2], default=True)
{'job': {'role': {'title': 'master of universe'}}}

Metadata

Release files for interdict 2020.11.1

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

Source distribution (sdist)

Source distribution for interdict 2020.11.1
File Size Uploaded Provenance
interdict-2020.11.1.tar.gz 3.0 kB Without provenance Details

Built distribution (wheel)

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

Total release size: 6.5 kB

Release files / interdict-2020.11.1.tar.gz

Download URL interdict-2020.11.1.tar.gz
Size 3.0 kB
Tags Source
SHA-256 checksum
How to use checksums
a7e671cb9c44991b86b1feb6b309d43f92fde6313876e3fcd615724cb9fbdf1b
BLAKE2b-256 checksum
How to use checksums
d80accfafea0f394b139e3598369b370c6f6503c45e22c4d6aa024a910dc5cf8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.4 CPython/3.8.5 Linux/4.19.128-microsoft-standard

Release files / interdict-2020.11.1-py3-none-any.whl

Download URL interdict-2020.11.1-py3-none-any.whl
Size 3.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
937b6b304b34b0f8ae0451e4288914c157876de4080c3d51abcafbc108aab88a
BLAKE2b-256 checksum
How to use checksums
b1b3d784d51b16a5d35e70bdd389e1e00dbcda70af12301551ccd092baeb9a6d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.4 CPython/3.8.5 Linux/4.19.128-microsoft-standard

Security for interdict 2020.11.1

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.

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