A Wireshark-like display filter for dictionaries.
Project description
Python Dictionary Display Filter
Wireshark-like display filter for python dictionaries.
Setup
pip3 install python-dict-display-filter
Usage
The basics and the syntax of the display filter are described in the User Guide.
If you want to see some advanced examples of how python-dict-display-filter
can be put to use checkout the
Examples.
If you want to use python-dict-display-filter
in your own application and customize it to your needs
check out the
Developer Guide.
Examples
Initialize DictDisplayFilter
with a dictionary:
> from pydictdisplayfilter import DictDisplayFilter
> actors = [
{"name": ["Laurence", "Fishburne"], "age": {"born": "1961"}, "gender": "male"},
{"name": ["Keanu", "Reeves"], "age": {"born": "1964"}, "gender": "male", "power": ["flight", "bulle-time"]},
{"name": ["Joe", "Pantoliano"], "age": {"born": "1951"}, "gender": "male"},
{"name": ["Carrie-Anne", "Moss"], "age": {"born": "1967"}, "gender": "female"}
]
> ddf = DictDisplayFilter(actors)
Show only actors with some kind of super-power:
> ddf.filter("power")
Show only actors which were born before 1965:
> ddf.filter("age.born < 1965")
Show only female actors:
> ddf.filter("gender == female")
Show all male actors which are born between 1960 and 1965:
> ddf.filter("gender == male and (age.born > 1960 and age.born < 1965)")
Show all actors which name contain the character 'e':
> ddf.filter("name contains e")
Show all actors which name matches a regular expression:
> ddf.filter("name matches .*e$")
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
Built Distribution
Hashes for python-dict-display-filter-0.9.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | e25e37b9adb7d477ffd298213d49d84f009e7f702635a363f7a133c49e060506 |
|
MD5 | 2bc47377570d1511deed51232de8c542 |
|
BLAKE2b-256 | 39566622f5a0266b86b6a2718c054c64f79f2b8257edc665ee77db8bfff68eca |
Hashes for python_dict_display_filter-0.9.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5ee47a01bb1489c9bb6b8b9bb2060f93206546329f7f5c2c37e2c737757696f1 |
|
MD5 | 3c709670ebadfc26711d83d417c5e387 |
|
BLAKE2b-256 | 48c79f07ac5bf4db2a512c393ce5bfab08d21d37716d1f516d18758352dce838 |