Dictionary filter
Project description
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'}}
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
interdict-2020.11.0a2.tar.gz
(2.8 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file interdict-2020.11.0a2.tar.gz.
File metadata
- Download URL: interdict-2020.11.0a2.tar.gz
- Upload date:
- Size: 2.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.4 CPython/3.8.5 Linux/4.19.128-microsoft-standard
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7055255814d84a2b38f5924d7232df458b231538c6c9e849ab176328dcb9f4e5
|
|
| MD5 |
0e0a9e429ea15ec7de59741592d259cc
|
|
| BLAKE2b-256 |
b3b90e2bd5ed340dba127270fe6ac412bb19bbed1b4ff24cdf9a5d9d9db3d373
|
File details
Details for the file interdict-2020.11.0a2-py3-none-any.whl.
File metadata
- Download URL: interdict-2020.11.0a2-py3-none-any.whl
- Upload date:
- Size: 3.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.4 CPython/3.8.5 Linux/4.19.128-microsoft-standard
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a92b6920a870e90c8aef1536d0a18ad60dd2d66c477902a316246f756c3e7277
|
|
| MD5 |
21a5ee9c7d2295f6aef7f4de91975f1a
|
|
| BLAKE2b-256 |
dac69b3010d919d7118080e0d194e12327cffd274a44a3ab9c2646728e68ae1a
|