python-dict-display-filter


Namepython-dict-display-filter JSON
Version 1.0.0 PyPI version JSON
download
home_pagehttps://github.com/bytebutcher/python-dict-display-filter
SummaryA Wireshark-like display filter for dictionaries.
upload_time2023-07-04 10:03:32
maintainer
docs_urlNone
authorbytebutcher
requires_python
licenseGPL-3.0
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI
coveralls test coverage No coveralls.
            <p align="center">
    <img src="https://github.com/bytebutcher/python-dict-display-filter/raw/main/images/python_dict_display_filter_logo.png" alt="python_dict_display_filter Logo"/>
</p>
<h1 align="center" style="margin-top: 0px;">Python Dictionary Display Filter</h1>
<div align="center">

![made-with-python](https://img.shields.io/badge/Made%20with-Python-1f425f.svg)
![PyPI](https://img.shields.io/pypi/v/python-dict-display-filter)
![GitHub](https://img.shields.io/github/license/bytebutcher/python-dict-display-filter)
![Build Status](https://img.shields.io/travis/com/bytebutcher/python-dict-display-filter)
![Coverage](https://img.shields.io/codecov/c/github/bytebutcher/python-dict-display-filter)
</div>
<br>

A Wireshark-like display filter for Python dictionaries. This tool allows you to easily filter, analyze, and 
manipulate data in Python dictionaries. It offers a range of features including comparison operators, 
combining operators, membership operators, and more. 

## Table of Contents
1. [Quick Start](#quick-start)
2. [Features](#features)
3. [Examples](#examples)
4. [Acknowledgements](#acknowledgements)

## Quick Start

Here's a simple example to get you started. First, install the package:

```commandline
pip3 install python-dict-display-filter
```

Then, use it to filter a list of dictionaries:
```
from pydictdisplayfilter import DictDisplayFilter
actors = [
    {"name": ["Laurence", "Fishburne"], "age": {"born": "1961"}, "gender": "male"},
    {"name": ["Keanu", "Reeves"], "age": {"born": "1964"}, "gender": "male", "power": ["flight", "bullet-time"]},
    {"name": ["Joe", "Pantoliano"], "age": {"born": "1951"}, "gender": "male"},
    {"name": ["Carrie-Anne", "Moss"], "age": {"born": "1967"}, "gender": "female"}
]
ddf = DictDisplayFilter(actors)

# This will filter the list to show only male actors born between 1960 and 1965 whose names end with 'e'
filtered_actors = ddf.filter("gender == male and (age.born > 1960 and age.born < 1965) and name matches .*e$")

print(list(filtered_actors))
[{'name': ['Laurence', 'Fishburne'], 'age': {'born': '1961'}, 'gender': 'male'}]
```

For more details, please refer to the 
<a href="https://github.com/bytebutcher/python-dict-display-filter/blob/main/docs/USER_GUIDE.md">User Guide</a>.

## Features

Python Dictionary Display Filter supports a wide range of features, including:
* **Comparison Operators:** ```==```, ```!=```, ```<=```, ```<```, ```>=```, ```>```, ```~=```, ```~```, ```&```
* **Combining Operators:** ```and```, ```or```, ```xor```, ```not``` 
* **Membership Operators:** ```in```
* **Types:** ```Text```, ```Number```, ```Date & Time```, ```Ethernet-```, ```IPv4-```, ```IPv6-Address```
* **Slicing:** ```Text```, ```Ethernet-```, ```IPv4-```, ```IPv6-Address```
* **Functions:** ```upper```, ```lower```, ```len```
* **Data Sources**: ```CSV```, ```Dictionaries```, ```JSON```, ```SQLite```

For a detailed description of the individual features check out the
<a href="https://github.com/bytebutcher/python-dict-display-filter/blob/main/docs/USER_GUIDE.md">User Guide</a>.

## Examples 

For detailed examples of how the display filter can be utilized, please refer to the following:

* [CSV Display Filter](https://github.com/bytebutcher/python-dict-display-filter/blob/main/docs/EXAMPLES.md#csv-display-filter)
* [JSON Display Filter](https://github.com/bytebutcher/python-dict-display-filter/blob/main/docs/EXAMPLES.md#json-display-filter)
* [SQLite Display Filter](https://github.com/bytebutcher/python-dict-display-filter/blob/main/docs/EXAMPLES.md#sqlite-display-filter)
* [Nmap Display Filter](https://github.com/bytebutcher/python-dict-display-filter/blob/main/docs/EXAMPLES.md#nmap-display-filter)

## Acknowledgements

This project wouldn't be possible without these awesome projects:

* <a href="https://wiki.wireshark.org/DisplayFilters">wireshark display filter</a>: Display filter for filtering network packages
* <a href="https://github.com/wolever/parameterized">parameterized</a>: Parameterized testing with any Python test framework
* <a href="https://github.com/pyparsing/pyparsing/">pyparsing</a>: Creating PEG-parsers made easy
* <a href="https://github.com/bytebutcher/ipranger/">ipranger</a>: Parsing and matching IPv4-addresses
* <a href="https://pypi.org/project/python-dateutil/">python-dateutil</a>: Parsing and comparing dates 

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/bytebutcher/python-dict-display-filter",
    "name": "python-dict-display-filter",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "",
    "author": "bytebutcher",
    "author_email": "thomas.engel.web@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/24/ea/fd79fed36b547ac85578c18ea66b527ea61767deb7a797ad9c98945669fc/python-dict-display-filter-1.0.0.tar.gz",
    "platform": null,
    "description": "<p align=\"center\">\n    <img src=\"https://github.com/bytebutcher/python-dict-display-filter/raw/main/images/python_dict_display_filter_logo.png\" alt=\"python_dict_display_filter Logo\"/>\n</p>\n<h1 align=\"center\" style=\"margin-top: 0px;\">Python Dictionary Display Filter</h1>\n<div align=\"center\">\n\n![made-with-python](https://img.shields.io/badge/Made%20with-Python-1f425f.svg)\n![PyPI](https://img.shields.io/pypi/v/python-dict-display-filter)\n![GitHub](https://img.shields.io/github/license/bytebutcher/python-dict-display-filter)\n![Build Status](https://img.shields.io/travis/com/bytebutcher/python-dict-display-filter)\n![Coverage](https://img.shields.io/codecov/c/github/bytebutcher/python-dict-display-filter)\n</div>\n<br>\n\nA Wireshark-like display filter for Python dictionaries. This tool allows you to easily filter, analyze, and \nmanipulate data in Python dictionaries. It offers a range of features including comparison operators, \ncombining operators, membership operators, and more. \n\n## Table of Contents\n1. [Quick Start](#quick-start)\n2. [Features](#features)\n3. [Examples](#examples)\n4. [Acknowledgements](#acknowledgements)\n\n## Quick Start\n\nHere's a simple example to get you started. First, install the package:\n\n```commandline\npip3 install python-dict-display-filter\n```\n\nThen, use it to filter a list of dictionaries:\n```\nfrom pydictdisplayfilter import DictDisplayFilter\nactors = [\n    {\"name\": [\"Laurence\", \"Fishburne\"], \"age\": {\"born\": \"1961\"}, \"gender\": \"male\"},\n    {\"name\": [\"Keanu\", \"Reeves\"], \"age\": {\"born\": \"1964\"}, \"gender\": \"male\", \"power\": [\"flight\", \"bullet-time\"]},\n    {\"name\": [\"Joe\", \"Pantoliano\"], \"age\": {\"born\": \"1951\"}, \"gender\": \"male\"},\n    {\"name\": [\"Carrie-Anne\", \"Moss\"], \"age\": {\"born\": \"1967\"}, \"gender\": \"female\"}\n]\nddf = DictDisplayFilter(actors)\n\n# This will filter the list to show only male actors born between 1960 and 1965 whose names end with 'e'\nfiltered_actors = ddf.filter(\"gender == male and (age.born > 1960 and age.born < 1965) and name matches .*e$\")\n\nprint(list(filtered_actors))\n[{'name': ['Laurence', 'Fishburne'], 'age': {'born': '1961'}, 'gender': 'male'}]\n```\n\nFor more details, please refer to the \n<a href=\"https://github.com/bytebutcher/python-dict-display-filter/blob/main/docs/USER_GUIDE.md\">User Guide</a>.\n\n## Features\n\nPython Dictionary Display Filter supports a wide range of features, including:\n* **Comparison Operators:** ```==```, ```!=```, ```<=```, ```<```, ```>=```, ```>```, ```~=```, ```~```, ```&```\n* **Combining Operators:** ```and```, ```or```, ```xor```, ```not``` \n* **Membership Operators:** ```in```\n* **Types:** ```Text```, ```Number```, ```Date & Time```, ```Ethernet-```, ```IPv4-```, ```IPv6-Address```\n* **Slicing:** ```Text```, ```Ethernet-```, ```IPv4-```, ```IPv6-Address```\n* **Functions:** ```upper```, ```lower```, ```len```\n* **Data Sources**: ```CSV```, ```Dictionaries```, ```JSON```, ```SQLite```\n\nFor a detailed description of the individual features check out the\n<a href=\"https://github.com/bytebutcher/python-dict-display-filter/blob/main/docs/USER_GUIDE.md\">User Guide</a>.\n\n## Examples \n\nFor detailed examples of how the display filter can be utilized, please refer to the following:\n\n* [CSV Display Filter](https://github.com/bytebutcher/python-dict-display-filter/blob/main/docs/EXAMPLES.md#csv-display-filter)\n* [JSON Display Filter](https://github.com/bytebutcher/python-dict-display-filter/blob/main/docs/EXAMPLES.md#json-display-filter)\n* [SQLite Display Filter](https://github.com/bytebutcher/python-dict-display-filter/blob/main/docs/EXAMPLES.md#sqlite-display-filter)\n* [Nmap Display Filter](https://github.com/bytebutcher/python-dict-display-filter/blob/main/docs/EXAMPLES.md#nmap-display-filter)\n\n## Acknowledgements\n\nThis project wouldn't be possible without these awesome projects:\n\n* <a href=\"https://wiki.wireshark.org/DisplayFilters\">wireshark display filter</a>: Display filter for filtering network packages\n* <a href=\"https://github.com/wolever/parameterized\">parameterized</a>: Parameterized testing with any Python test framework\n* <a href=\"https://github.com/pyparsing/pyparsing/\">pyparsing</a>: Creating PEG-parsers made easy\n* <a href=\"https://github.com/bytebutcher/ipranger/\">ipranger</a>: Parsing and matching IPv4-addresses\n* <a href=\"https://pypi.org/project/python-dateutil/\">python-dateutil</a>: Parsing and comparing dates \n",
    "bugtrack_url": null,
    "license": "GPL-3.0",
    "summary": "A Wireshark-like display filter for dictionaries.",
    "version": "1.0.0",
    "project_urls": {
        "Homepage": "https://github.com/bytebutcher/python-dict-display-filter"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "9a7a82e1d0f6032781ad328ec9ff6a26ca8112da51b9b8da2217baba37693030",
                "md5": "f4f94868d4c8cd5a59252d04d0de22e5",
                "sha256": "1be865c3fc94e12ed6785d03865a7be6654310ddf5ed826e433dc2aea8a1a661"
            },
            "downloads": -1,
            "filename": "python_dict_display_filter-1.0.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "f4f94868d4c8cd5a59252d04d0de22e5",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 52898,
            "upload_time": "2023-07-04T10:03:29",
            "upload_time_iso_8601": "2023-07-04T10:03:29.651318Z",
            "url": "https://files.pythonhosted.org/packages/9a/7a/82e1d0f6032781ad328ec9ff6a26ca8112da51b9b8da2217baba37693030/python_dict_display_filter-1.0.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "24eafd79fed36b547ac85578c18ea66b527ea61767deb7a797ad9c98945669fc",
                "md5": "492ad44987d5131e7a2c48f0fb8b620c",
                "sha256": "e9c0ea92a73ad4ca563e12e2c4bc53cf463e56be9a617ae7295b9644d7aa38ce"
            },
            "downloads": -1,
            "filename": "python-dict-display-filter-1.0.0.tar.gz",
            "has_sig": false,
            "md5_digest": "492ad44987d5131e7a2c48f0fb8b620c",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 38134,
            "upload_time": "2023-07-04T10:03:32",
            "upload_time_iso_8601": "2023-07-04T10:03:32.069279Z",
            "url": "https://files.pythonhosted.org/packages/24/ea/fd79fed36b547ac85578c18ea66b527ea61767deb7a797ad9c98945669fc/python-dict-display-filter-1.0.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-07-04 10:03:32",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "bytebutcher",
    "github_project": "python-dict-display-filter",
    "travis_ci": true,
    "coveralls": false,
    "github_actions": true,
    "lcname": "python-dict-display-filter"
}
        
Elapsed time: 0.08827s