From b45b3408a67bb55affbffaf302d7f1739bb6bfc4 Mon Sep 17 00:00:00 2001 From: bytebutcher Date: Fri, 7 Jul 2023 10:40:55 +0200 Subject: [PATCH] #9 Rebranding --- .github/workflows/codecov.yml | 2 +- README.md | 82 +++++++++-------- docs/DEVELOPER_GUIDE.md | 8 +- docs/USER_GUIDE.md | 84 ++++++++++-------- examples/csv_display_filter.py | 4 +- examples/json_display_filter.py | 10 +-- examples/nmap_display_filter.py | 4 +- examples/sqlite_display_filter.py | 10 +-- ...isplay_filter_logo.png => pydfql_logo.png} | Bin {pydictdisplayfilter => pydfql}/__init__.py | 4 +- .../display_filters.py | 14 +-- .../evaluators/__init__.py | 4 +- .../evaluators/common.py | 4 +- {pydictdisplayfilter => pydfql}/exceptions.py | 2 +- {pydictdisplayfilter => pydfql}/factories.py | 4 +- {pydictdisplayfilter => pydfql}/helpers.py | 10 +-- {pydictdisplayfilter => pydfql}/models.py | 2 +- .../parsers/__init__.py | 4 +- .../parsers/common.py | 2 +- .../parsers/display_filter.py | 8 +- {pydictdisplayfilter => pydfql}/slicers.py | 4 +- setup.py | 8 +- tests/__init__.py | 2 +- tests/test_csv_display_filter_example.py | 2 +- tests/test_dict_display_filter.py | 6 +- tests/test_dict_display_filter_shell.py | 4 +- tests/test_display_filter_parser.py | 8 +- tests/test_json_display_filter_example.py | 2 +- tests/test_nmap_display_filter_example.py | 2 +- tests/test_object_display_filter.py | 4 +- tests/test_slicers.py | 6 +- tests/test_sql_display_filter.py | 4 +- tests/test_sqlite_display_filter_example.py | 2 +- tests/test_table.py | 4 +- 34 files changed, 166 insertions(+), 154 deletions(-) rename images/{python_dict_display_filter_logo.png => pydfql_logo.png} (100%) rename {pydictdisplayfilter => pydfql}/__init__.py (88%) rename {pydictdisplayfilter => pydfql}/display_filters.py (96%) rename {pydictdisplayfilter => pydfql}/evaluators/__init__.py (97%) rename {pydictdisplayfilter => pydfql}/evaluators/common.py (99%) rename {pydictdisplayfilter => pydfql}/exceptions.py (96%) rename {pydictdisplayfilter => pydfql}/factories.py (89%) rename {pydictdisplayfilter => pydfql}/helpers.py (96%) rename {pydictdisplayfilter => pydfql}/models.py (96%) rename {pydictdisplayfilter => pydfql}/parsers/__init__.py (84%) rename {pydictdisplayfilter => pydfql}/parsers/common.py (98%) rename {pydictdisplayfilter => pydfql}/parsers/display_filter.py (97%) rename {pydictdisplayfilter => pydfql}/slicers.py (98%) diff --git a/.github/workflows/codecov.yml b/.github/workflows/codecov.yml index 403e158..2e20a5f 100644 --- a/.github/workflows/codecov.yml +++ b/.github/workflows/codecov.yml @@ -1,4 +1,4 @@ -name: Workflow for Codecov python-dict-display-filter +name: Workflow for Codecov pydfql on: [push, pull_request] jobs: run: diff --git a/README.md b/README.md index 398b603..3044f07 100644 --- a/README.md +++ b/README.md @@ -1,59 +1,71 @@

- python_dict_display_filter Logo + pydfql Logo

-

Python Dictionary Display Filter

+

Python Display Filter Query Language

![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) +![PyPI](https://img.shields.io/pypi/v/pydfql) +![GitHub](https://img.shields.io/github/license/bytebutcher/pydfql) +![Build Status](https://img.shields.io/travis/com/bytebutcher/pydfql) +![Coverage](https://img.shields.io/codecov/c/github/bytebutcher/pydfql)

-A Wireshark-like display filter for Python dictionaries and various other data -sources, including objects, lists, and SQL databases. +A Wireshark-like display filter various data formats, including Python dictionaries, lists, objects, and SQL databases. ## Table of Contents 1. [Quick Start](#quick-start) -2. [Features](#features) -3. [Examples](#examples) -4. [Acknowledgements](#acknowledgements) + + 1.1 [Installation](#installation) + + 1.2 [Initialization](#initialization) + + 1.3 [Filtering Data](#filtering-data) + +2. [Examples](#examples) +3. [Acknowledgements](#acknowledgements) ## Quick Start -To quickly get started with the python-dictionary-display-filter, follow the steps below: +To quickly get started follow the steps below: ### Installation First, install the package using pip: ```commandline -pip3 install python-dict-display-filter +pip3 install pydfql ``` ### Initialization -Next, import the necessary module and initialize the ```DictDisplayFilter``` with a list of dictionaries: +Next, import the necessary module and initialize the appropriate display filter with some data. +In the example below we are initializing the ```ObjectDisplayFilter``` with a list of objects: ```python -from pydictdisplayfilter import DictDisplayFilter +from pydfql import ObjectDisplayFilter + +class Actor: + def __init__(self, name, age, gender): + self.name = name + self.age = age + self.gender = gender 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"} + Actor(["Laurence", "Fishburne"], {"born": "1961"}, "male"), + Actor(["Keanu", "Reeves"], {"born": "1964"}, "male"), + Actor(["Joe", "Pantoliano"], {"born": "1951"}, "male"), + Actor(["Carrie-Anne", "Moss"], {"born": "1967"}, "female") ] -ddf = DictDisplayFilter(actors) +df = ObjectDisplayFilter(actors) ``` ### Filtering Data -Once the ```DictDisplayFilter``` is initialized, you can start filtering the data using the -display filter query language. +Once the display filter is initialized, you can start filtering the data using the +display filter query language. For example, let's filter the actors whose birth year is after 1960: ```python filter_query = "age.born > 1960" -filtered_data = ddf.filter(filter_query) +filtered_data = df.filter(filter_query) print(list(filtered_data)) [ {"name": ["Laurence", "Fishburne"], "age": {"born": "1961"}, "gender": "male"}, @@ -67,7 +79,7 @@ For example, let's filter male actors born between 1960 and 1964 whose names end ```python filter_query = "gender == male and (age.born > 1960 and age.born < 1965) and name matches .*e$" -filtered_data = ddf.filter(filter_query) +filtered_data = df.filter(filter_query) print(list(filtered_data)) ``` @@ -76,32 +88,26 @@ This will output the filtered data: [{'name': ['Laurence', 'Fishburne'], 'age': {'born': '1961'}, 'gender': 'male'}] ``` -For more details and advanced usage, please refer to the -User Guide. - -## Features - -Python Dictionary Display Filter supports a wide range of features, including: +Overall, PyDFQL supports a wide range of features, including: +* **Data Types**: ```Dictionaries```, ```Lists```, ```Objects```, ```SQL``` * **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```, ```Objects```, ```SQLite``` For a detailed description of the individual features check out the -User Guide. +User Guide. ## Examples -For detailed examples of how the display filter can be utilized, please refer to the following sections of the -User Guide: +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/USER_GUIDE.md#51-csv-display-filter) -* [JSON Display Filter](https://github.com/bytebutcher/python-dict-display-filter/blob/main/docs/USER_GUIDE.md#52-json-display-filter) -* [SQLite Display Filter](https://github.com/bytebutcher/python-dict-display-filter/blob/main/docs/USER_GUIDE.md#53-sqlite-display-filter) -* [Nmap Display Filter](https://github.com/bytebutcher/python-dict-display-filter/blob/main/docs/USER_GUIDE.md#54-nmap-display-filter) +* [CSV Display Filter](https://github.com/bytebutcher/pydfql/blob/main/docs/USER_GUIDE.md#51-csv-display-filter) +* [JSON Display Filter](https://github.com/bytebutcher/pydfql/blob/main/docs/USER_GUIDE.md#52-json-display-filter) +* [SQLite Display Filter](https://github.com/bytebutcher/pydfql/blob/main/docs/USER_GUIDE.md#53-sqlite-display-filter) +* [Nmap Display Filter](https://github.com/bytebutcher/pydfql/blob/main/docs/USER_GUIDE.md#54-nmap-display-filter) ## Acknowledgements diff --git a/docs/DEVELOPER_GUIDE.md b/docs/DEVELOPER_GUIDE.md index fc8dc54..2f5edeb 100644 --- a/docs/DEVELOPER_GUIDE.md +++ b/docs/DEVELOPER_GUIDE.md @@ -1,7 +1,7 @@

- python_dict_display_filter Logo + pydfql Logo

-

Python Dictionary Display Filter
Developer Guide

+

Python Display Filter Query Language
Developer Guide


## Customizing Display Filters @@ -19,7 +19,7 @@ parameters: ## Exceptions -The ```python-dict-display-filter``` defines some custom exceptions which may be thrown during runtime: +```pydfql``` defines some custom exceptions which may be thrown during runtime: | Exception | Description | |------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| @@ -29,7 +29,7 @@ The ```python-dict-display-filter``` defines some custom exceptions which may be ## Helpers -The ```python-dict-display-filter``` defines a set of helpers which may be used in standalone applications: +```pydfql``` defines a set of helpers which may be used in standalone applications: | Helper Class | Description | |------------------------------|---------------------------------------------------------------------------------------------------------------------------------| diff --git a/docs/USER_GUIDE.md b/docs/USER_GUIDE.md index aefb949..be26e9a 100644 --- a/docs/USER_GUIDE.md +++ b/docs/USER_GUIDE.md @@ -1,7 +1,7 @@

- python_dict_display_filter Logo + pydfql Logo

-

Python Dictionary Display Filter
User Guide

+

Python Display Filter Query Language
User Guide


## Table of Contents @@ -50,46 +50,47 @@ ## 1. Introduction -The Python Dictionary Display Filter library allows filtering data using a custom +The Python Display Filter Query Language allows filtering data using a Wireshark-like query language. It provides a flexible and efficient way to extract specific information from various data -sources, including dictionaries, objects, lists, and SQL databases. +formats, including dictionaries, objects, lists, and SQL databases. -In this user guide, we will explore the installation process, an overview of how to work with various data sources, -a detailed explanation of the query language, and practical examples to demonstrate real-world usage. +In this user guide, we will explore the installation process, provide an overview of how to work with various data +formats, give a detailed explanation of the query language, and provide practical examples to demonstrate real-world +usage. By the end of this guide, you will have a comprehensive understanding of the -Python Dictionary Display Filter and be equipped to effectively filter and extract the data you need +Python Display Filter Query Language and be equipped to effectively filter and extract the data you need from diverse sources. ## 2. Installation -To install the Python Dictionary Display Filter, you can use the pip package manager. +To install ```pydfql``, you can use the pip package manager. Open your terminal or command prompt and run the following command: ```commandline -pip3 install python-dict-display-filter +pip3 install pydfql ``` -Now that you have installed the python-dictionary-display-filter application, +Now that you have installed ```pydfql```, let's move on to the next section and explore how to quickly get started with it. ## 3. Usage -The Python Dictionary Display Filter library provides support for filtering data from various sources. -While the name may suggest that it primarily works with dictionaries, it actually supports other kinds of data sources -as well. This section will provide an overview of how the Display Filter can be used for different data sources. +The ```pydfql``` library provides support for filtering data from various sources. +This section will provide an overview of how ```pydfql``` can be used for different data sources. ### 3.1 DictDisplayFilter The ```DictDisplayFilter``` allows to filter a list of dictionaries. **Example:** + ```python -from pydictdisplayfilter import DictDisplayFilter +from pydfql 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"} + {"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"} ] filter_query = "age.born > 1960 and age.born < 1965" @@ -101,20 +102,23 @@ print(list(filtered_data)) The ```ObjectDisplayFilter``` enables filtering a list of objects. **Example:** + ```python -from pydictdisplayfilter import ObjectDisplayFilter +from pydfql import ObjectDisplayFilter + class Actor: - def __init__(self, name, age, gender): - self.name = name - self.age = age - self.gender = gender + def __init__(self, name, age, gender): + self.name = name + self.age = age + self.gender = gender + actors = [ - Actor(["Laurence", "Fishburne"], {"born": "1961"}, "male"), - Actor(["Keanu", "Reeves"], {"born": "1964"}, "male"), - Actor(["Joe", "Pantoliano"], {"born": "1951"}, "male"), - Actor(["Carrie-Anne", "Moss"], {"born": "1967"}, "female") + Actor(["Laurence", "Fishburne"], {"born": "1961"}, "male"), + Actor(["Keanu", "Reeves"], {"born": "1964"}, "male"), + Actor(["Joe", "Pantoliano"], {"born": "1951"}, "male"), + Actor(["Carrie-Anne", "Moss"], {"born": "1967"}, "female") ] filter_query = "age.born > 1960" @@ -127,14 +131,15 @@ print(list(filtered_data)) The ```ListDisplayFilter``` allows filtering a list of lists. **Example:** + ```python -from pydictdisplayfilter import ListDisplayFilter +from pydfql import ListDisplayFilter data = [ - ["Morpheus", "Laurence Fishburne", 38, "male", False], - ["Neo", "Keanu Reeves", 35, "male", False], - ["Cipher", "Joe Pantoliano", 48, "male", True], - ["Trinity", "Carrie-Anne Moss", 32, "female", False] + ["Morpheus", "Laurence Fishburne", 38, "male", False], + ["Neo", "Keanu Reeves", 35, "male", False], + ["Cipher", "Joe Pantoliano", 48, "male", True], + ["Trinity", "Carrie-Anne Moss", 32, "female", False] ] filter_query = "age < 40" @@ -148,8 +153,9 @@ print(filtered_data) The ```SQLDisplayFilter``` allows filtering a SQL database table. **Example:** + ```python -from pydictdisplayfilter import SQLDisplayFilter +from pydfql import SQLDisplayFilter import sqlite3 database_file = './data/sqlite_example.sqlite' @@ -163,7 +169,7 @@ print(filtered_data) ## 4. Query Language -The query language in the python-dict-display-filter library provides a wide range of operations, comparisons, and +The query language provides a wide range of operations, comparisons, and logical operators to help retrieving the desired subset of data. This section introduces the query language and its components, including fields, comparisons, field types, combining expressions, slice operator, membership operator, and functions. @@ -401,7 +407,7 @@ The display filter language has a number of functions to convert fields: ## 5. Examples In this section, we will walk through various examples to demonstrate the practical usage of the -python-dictionary-display-filter. +```pydfql```. ### 5.1 CSV Display Filter @@ -428,7 +434,7 @@ Neo | 35 | male | False 1 row in set (0.01 secs) ``` -See examples/csv_display_filter.py for implementation details. +See examples/csv_display_filter.py for implementation details. ### 5.2 JSON Display Filter @@ -453,7 +459,7 @@ age.born 1 row in set (0.01 secs) ``` -See examples/json_display_filter.py for implementation details. +See examples/json_display_filter.py for implementation details. ### 5.3 Nmap Display Filter @@ -495,7 +501,7 @@ host | port | protocol | status | service 6 rows in set (0.01 secs) ``` -See examples/nmap_display_filter.py for implementation details. +See examples/nmap_display_filter.py for implementation details. ### 5.4 SQLite Display Filter @@ -531,7 +537,7 @@ Neo | Keanu Reeves | 35 | male | 0 1 row in set (0.01 secs) ``` -See examples/sqlite_display_filter.py for implementation details. +See examples/sqlite_display_filter.py for implementation details. ## 6. Acknowledgements diff --git a/examples/csv_display_filter.py b/examples/csv_display_filter.py index 8c53093..1429a14 100644 --- a/examples/csv_display_filter.py +++ b/examples/csv_display_filter.py @@ -1,6 +1,6 @@ # vim: ts=8:sts=8:sw=8:noexpandtab # -# This file is part of python-dict-display-filter. +# This file is part of pydfql. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -21,7 +21,7 @@ import sys import traceback -from pydictdisplayfilter.helpers import DictDisplayFilterShell +from pydfql.helpers import DictDisplayFilterShell def read_csv_file(csv_file): diff --git a/examples/json_display_filter.py b/examples/json_display_filter.py index 0c8e615..434ac9f 100644 --- a/examples/json_display_filter.py +++ b/examples/json_display_filter.py @@ -1,6 +1,6 @@ # vim: ts=8:sts=8:sw=8:noexpandtab # -# This file is part of python-dict-display-filter. +# This file is part of pydfql. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -22,10 +22,10 @@ import traceback from typing import List, Set, Dict, Callable -from pydictdisplayfilter import DictDisplayFilter -from pydictdisplayfilter.evaluators import Evaluator -from pydictdisplayfilter.helpers import Table, DisplayFilterShell -from pydictdisplayfilter.slicers import BasicSlicer +from pydfql import DictDisplayFilter +from pydfql.evaluators import Evaluator +from pydfql.helpers import Table, DisplayFilterShell +from pydfql.slicers import BasicSlicer def read_json_file(json_file): diff --git a/examples/nmap_display_filter.py b/examples/nmap_display_filter.py index 53c98dc..e244ce8 100644 --- a/examples/nmap_display_filter.py +++ b/examples/nmap_display_filter.py @@ -1,6 +1,6 @@ # vim: ts=8:sts=8:sw=8:noexpandtab # -# This file is part of python-dict-display-filter. +# This file is part of pydfql. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -22,7 +22,7 @@ from collections import defaultdict from typing import List -from pydictdisplayfilter.helpers import DictDisplayFilterShell +from pydfql.helpers import DictDisplayFilterShell try: from libnmap.objects import NmapHost diff --git a/examples/sqlite_display_filter.py b/examples/sqlite_display_filter.py index d10a583..7c0e485 100644 --- a/examples/sqlite_display_filter.py +++ b/examples/sqlite_display_filter.py @@ -1,6 +1,6 @@ # vim: ts=8:sts=8:sw=8:noexpandtab # -# This file is part of python-dict-display-filter. +# This file is part of pydfql. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -22,10 +22,10 @@ import traceback from typing import List, Dict, Callable -from pydictdisplayfilter.display_filters import SQLDisplayFilter -from pydictdisplayfilter.evaluators import Evaluator -from pydictdisplayfilter.helpers import DisplayFilterShell, Table, TableError -from pydictdisplayfilter.slicers import BasicSlicer +from pydfql.display_filters import SQLDisplayFilter +from pydfql.evaluators import Evaluator +from pydfql.helpers import DisplayFilterShell, Table, TableError +from pydfql.slicers import BasicSlicer class TableNotFoundError(TableError): diff --git a/images/python_dict_display_filter_logo.png b/images/pydfql_logo.png similarity index 100% rename from images/python_dict_display_filter_logo.png rename to images/pydfql_logo.png diff --git a/pydictdisplayfilter/__init__.py b/pydfql/__init__.py similarity index 88% rename from pydictdisplayfilter/__init__.py rename to pydfql/__init__.py index e2dceae..119892d 100644 --- a/pydictdisplayfilter/__init__.py +++ b/pydfql/__init__.py @@ -1,6 +1,6 @@ # vim: ts=8:sts=8:sw=8:noexpandtab # -# This file is part of python-dict-display-filter. +# This file is part of pydfql. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -14,5 +14,5 @@ # # You should have received a copy of the GNU General Public License # along with this program. If not, see . -from pydictdisplayfilter.display_filters import \ +from pydfql.display_filters import \ DictDisplayFilter, ListDisplayFilter, ObjectDisplayFilter, SQLDisplayFilter diff --git a/pydictdisplayfilter/display_filters.py b/pydfql/display_filters.py similarity index 96% rename from pydictdisplayfilter/display_filters.py rename to pydfql/display_filters.py index c4a59a2..356c596 100644 --- a/pydictdisplayfilter/display_filters.py +++ b/pydfql/display_filters.py @@ -1,6 +1,6 @@ # vim: ts=8:sts=8:sw=8:noexpandtab # -# This file is part of python-dict-display-filter. +# This file is part of pydfql. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -19,12 +19,12 @@ from sqlite3 import Connection from typing import List, Dict, Callable, Union -from pydictdisplayfilter.evaluators import Evaluator, DefaultEvaluator -from pydictdisplayfilter.exceptions import EvaluationError -from pydictdisplayfilter.models import Expression -from pydictdisplayfilter.factories import SlicerFactory -from pydictdisplayfilter.parsers import DisplayFilterParser -from pydictdisplayfilter.slicers import BasicSlicer +from pydfql.evaluators import Evaluator, DefaultEvaluator +from pydfql.exceptions import EvaluationError +from pydfql.models import Expression +from pydfql.factories import SlicerFactory +from pydfql.parsers import DisplayFilterParser +from pydfql.slicers import BasicSlicer class BaseDisplayFilter(ABC): diff --git a/pydictdisplayfilter/evaluators/__init__.py b/pydfql/evaluators/__init__.py similarity index 97% rename from pydictdisplayfilter/evaluators/__init__.py rename to pydfql/evaluators/__init__.py index 21800bb..ea0e466 100644 --- a/pydictdisplayfilter/evaluators/__init__.py +++ b/pydfql/evaluators/__init__.py @@ -1,6 +1,6 @@ # vim: ts=8:sts=8:sw=8:noexpandtab # -# This file is part of python-dict-display-filter. +# This file is part of pydfql. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -16,7 +16,7 @@ # along with this program. If not, see . import re from typing import List, Dict -from pydictdisplayfilter.evaluators.common import FieldEvaluator, IPv4RangeEvaluator, ListEvaluator, NumberEvaluator, \ +from pydfql.evaluators.common import FieldEvaluator, IPv4RangeEvaluator, ListEvaluator, NumberEvaluator, \ IntegerEvaluator, StringEvaluator, DateEvaluator, IPv4AddressEvaluator, IPv6AddressEvaluator, AbstractBasicEvaluator, \ VersionStringEvaluator diff --git a/pydictdisplayfilter/evaluators/common.py b/pydfql/evaluators/common.py similarity index 99% rename from pydictdisplayfilter/evaluators/common.py rename to pydfql/evaluators/common.py index 7131e88..abdc459 100644 --- a/pydictdisplayfilter/evaluators/common.py +++ b/pydfql/evaluators/common.py @@ -1,6 +1,6 @@ # vim: ts=8:sts=8:sw=8:noexpandtab # -# This file is part of python-dict-display-filter. +# This file is part of pydfql. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -24,7 +24,7 @@ from dateutil.parser import parse as parse_date from packaging import version -from pydictdisplayfilter.exceptions import EvaluationError +from pydfql.exceptions import EvaluationError class AbstractEvaluator(ABC): diff --git a/pydictdisplayfilter/exceptions.py b/pydfql/exceptions.py similarity index 96% rename from pydictdisplayfilter/exceptions.py rename to pydfql/exceptions.py index 863a8a9..87cfa33 100644 --- a/pydictdisplayfilter/exceptions.py +++ b/pydfql/exceptions.py @@ -1,6 +1,6 @@ # vim: ts=8:sts=8:sw=8:noexpandtab # -# This file is part of python-dict-display-filter. +# This file is part of pydfql. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/pydictdisplayfilter/factories.py b/pydfql/factories.py similarity index 89% rename from pydictdisplayfilter/factories.py rename to pydfql/factories.py index e237416..304db25 100644 --- a/pydictdisplayfilter/factories.py +++ b/pydfql/factories.py @@ -1,6 +1,6 @@ # vim: ts=8:sts=8:sw=8:noexpandtab # -# This file is part of python-dict-display-filter. +# This file is part of pydfql. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -16,7 +16,7 @@ # along with this program. If not, see . from typing import List -from pydictdisplayfilter.slicers import MacSlicer, BasicSlicer, IPv4Slicer, IPv6Slicer +from pydfql.slicers import MacSlicer, BasicSlicer, IPv4Slicer, IPv6Slicer class SlicerFactory: diff --git a/pydictdisplayfilter/helpers.py b/pydfql/helpers.py similarity index 96% rename from pydictdisplayfilter/helpers.py rename to pydfql/helpers.py index 956c736..e4d5220 100644 --- a/pydictdisplayfilter/helpers.py +++ b/pydfql/helpers.py @@ -1,6 +1,6 @@ # vim: ts=8:sts=8:sw=8:noexpandtab # -# This file is part of python-dict-display-filter. +# This file is part of pydfql. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -23,10 +23,10 @@ from itertools import chain from typing import List, Dict, Callable -from pydictdisplayfilter.display_filters import BaseDisplayFilter, DictDisplayFilter -from pydictdisplayfilter.evaluators import Evaluator -from pydictdisplayfilter.exceptions import ParserError, EvaluationError -from pydictdisplayfilter.slicers import BasicSlicer +from pydfql.display_filters import BaseDisplayFilter, DictDisplayFilter +from pydfql.evaluators import Evaluator +from pydfql.exceptions import ParserError, EvaluationError +from pydfql.slicers import BasicSlicer class TableError(Exception): diff --git a/pydictdisplayfilter/models.py b/pydfql/models.py similarity index 96% rename from pydictdisplayfilter/models.py rename to pydfql/models.py index f2a6195..51f0982 100644 --- a/pydictdisplayfilter/models.py +++ b/pydfql/models.py @@ -1,6 +1,6 @@ # vim: ts=8:sts=8:sw=8:noexpandtab # -# This file is part of python-dict-display-filter. +# This file is part of pydfql. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/pydictdisplayfilter/parsers/__init__.py b/pydfql/parsers/__init__.py similarity index 84% rename from pydictdisplayfilter/parsers/__init__.py rename to pydfql/parsers/__init__.py index 840d0cc..196ce9d 100644 --- a/pydictdisplayfilter/parsers/__init__.py +++ b/pydfql/parsers/__init__.py @@ -1,6 +1,6 @@ # vim: ts=8:sts=8:sw=8:noexpandtab # -# This file is part of python-dict-display-filter. +# This file is part of pydfql. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -14,4 +14,4 @@ # # You should have received a copy of the GNU General Public License # along with this program. If not, see . -from pydictdisplayfilter.parsers.display_filter import DisplayFilterParser \ No newline at end of file +from pydfql.parsers.display_filter import DisplayFilterParser \ No newline at end of file diff --git a/pydictdisplayfilter/parsers/common.py b/pydfql/parsers/common.py similarity index 98% rename from pydictdisplayfilter/parsers/common.py rename to pydfql/parsers/common.py index 4d411a6..dc64dc2 100644 --- a/pydictdisplayfilter/parsers/common.py +++ b/pydfql/parsers/common.py @@ -1,6 +1,6 @@ # vim: ts=8:sts=8:sw=8:noexpandtab # -# This file is part of python-dict-display-filter. +# This file is part of pydfql. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/pydictdisplayfilter/parsers/display_filter.py b/pydfql/parsers/display_filter.py similarity index 97% rename from pydictdisplayfilter/parsers/display_filter.py rename to pydfql/parsers/display_filter.py index 39c0401..216662e 100644 --- a/pydictdisplayfilter/parsers/display_filter.py +++ b/pydfql/parsers/display_filter.py @@ -1,6 +1,6 @@ # vim: ts=8:sts=8:sw=8:noexpandtab # -# This file is part of python-dict-display-filter. +# This file is part of pydfql. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -16,9 +16,9 @@ # along with this program. If not, see . import pyparsing as pp from typing import List, Union, Optional, Callable, Dict -from pydictdisplayfilter.exceptions import ParserError -from pydictdisplayfilter.models import Expression -from pydictdisplayfilter.parsers import common as pc +from pydfql.exceptions import ParserError +from pydfql.models import Expression +from pydfql.parsers import common as pc class DisplayFilterParser: diff --git a/pydictdisplayfilter/slicers.py b/pydfql/slicers.py similarity index 98% rename from pydictdisplayfilter/slicers.py rename to pydfql/slicers.py index d64ba21..d2e8f0e 100644 --- a/pydictdisplayfilter/slicers.py +++ b/pydfql/slicers.py @@ -1,6 +1,6 @@ # vim: ts=8:sts=8:sw=8:noexpandtab # -# This file is part of python-dict-display-filter. +# This file is part of pydfql. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -19,7 +19,7 @@ import pyparsing as pp -from pydictdisplayfilter.exceptions import ProgrammingError +from pydfql.exceptions import ProgrammingError class BasicSlicer: diff --git a/setup.py b/setup.py index 9ccbab7..965f1aa 100644 --- a/setup.py +++ b/setup.py @@ -10,12 +10,12 @@ # This call to setup() does all the work setup( - name="python-dict-display-filter", - version="1.2.0", - description="A Wireshark-like display filter for dictionaries.", + name="pydfql", + version="1.3.0", + description="A Wireshark-like display filter for querying data.", long_description=README, long_description_content_type="text/markdown", - url="https://github.com/bytebutcher/python-dict-display-filter", + url="https://github.com/bytebutcher/pyqfql", author="bytebutcher", author_email="thomas.engel.web@gmail.com", license="GPL-3.0", diff --git a/tests/__init__.py b/tests/__init__.py index 86c0eb0..8992a0b 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -1,6 +1,6 @@ # vim: ts=8:sts=8:sw=8:noexpandtab # -# This file is part of python-dict-display-filter. +# This file is part of pydfql. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/tests/test_csv_display_filter_example.py b/tests/test_csv_display_filter_example.py index ad151b9..8438d1e 100644 --- a/tests/test_csv_display_filter_example.py +++ b/tests/test_csv_display_filter_example.py @@ -1,6 +1,6 @@ # vim: ts=8:sts=8:sw=8:noexpandtab # -# This file is part of python-dict-display-filter. +# This file is part of pydfql. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/tests/test_dict_display_filter.py b/tests/test_dict_display_filter.py index ed6c053..3be11b0 100644 --- a/tests/test_dict_display_filter.py +++ b/tests/test_dict_display_filter.py @@ -1,6 +1,6 @@ # vim: ts=8:sts=8:sw=8:noexpandtab # -# This file is part of python-dict-display-filter. +# This file is part of pydfql. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -18,8 +18,8 @@ from parameterized import parameterized -from pydictdisplayfilter.display_filters import DictDisplayFilter -from pydictdisplayfilter.exceptions import ParserError +from pydfql.display_filters import DictDisplayFilter +from pydfql.exceptions import ParserError class TestDictDisplayFilter(unittest.TestCase): diff --git a/tests/test_dict_display_filter_shell.py b/tests/test_dict_display_filter_shell.py index ac85b58..63b31d6 100644 --- a/tests/test_dict_display_filter_shell.py +++ b/tests/test_dict_display_filter_shell.py @@ -1,6 +1,6 @@ # vim: ts=8:sts=8:sw=8:noexpandtab # -# This file is part of python-dict-display-filter. +# This file is part of pydfql. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -21,7 +21,7 @@ from unittest import mock -from pydictdisplayfilter.helpers import DictDisplayFilterShell +from pydfql.helpers import DictDisplayFilterShell class TestDictDisplayFilterShell(unittest.TestCase): diff --git a/tests/test_display_filter_parser.py b/tests/test_display_filter_parser.py index b52a5db..ae0ab1d 100644 --- a/tests/test_display_filter_parser.py +++ b/tests/test_display_filter_parser.py @@ -1,6 +1,6 @@ # vim: ts=8:sts=8:sw=8:noexpandtab # -# This file is part of python-dict-display-filter. +# This file is part of pydfql. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -16,9 +16,9 @@ # along with this program. If not, see . from parameterized import parameterized -from pydictdisplayfilter.exceptions import ParserError -from pydictdisplayfilter.models import Expression -from pydictdisplayfilter.parsers import DisplayFilterParser +from pydfql.exceptions import ParserError +from pydfql.models import Expression +from pydfql.parsers import DisplayFilterParser from tests import TestCase diff --git a/tests/test_json_display_filter_example.py b/tests/test_json_display_filter_example.py index c3a1301..8437a87 100644 --- a/tests/test_json_display_filter_example.py +++ b/tests/test_json_display_filter_example.py @@ -1,6 +1,6 @@ # vim: ts=8:sts=8:sw=8:noexpandtab # -# This file is part of python-dict-display-filter. +# This file is part of pydfql. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/tests/test_nmap_display_filter_example.py b/tests/test_nmap_display_filter_example.py index fd1a45e..943666c 100644 --- a/tests/test_nmap_display_filter_example.py +++ b/tests/test_nmap_display_filter_example.py @@ -1,6 +1,6 @@ # vim: ts=8:sts=8:sw=8:noexpandtab # -# This file is part of python-dict-display-filter. +# This file is part of pydfql. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/tests/test_object_display_filter.py b/tests/test_object_display_filter.py index 80ce5bc..18b8b68 100644 --- a/tests/test_object_display_filter.py +++ b/tests/test_object_display_filter.py @@ -1,6 +1,6 @@ # vim: ts=8:sts=8:sw=8:noexpandtab # -# This file is part of python-dict-display-filter. +# This file is part of pydfql. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -20,7 +20,7 @@ from parameterized import parameterized -from pydictdisplayfilter.display_filters import ObjectDisplayFilter +from pydfql.display_filters import ObjectDisplayFilter class Person: diff --git a/tests/test_slicers.py b/tests/test_slicers.py index 1403294..9d9c81e 100644 --- a/tests/test_slicers.py +++ b/tests/test_slicers.py @@ -1,6 +1,6 @@ # vim: ts=8:sts=8:sw=8:noexpandtab # -# This file is part of python-dict-display-filter. +# This file is part of pydfql. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -16,9 +16,9 @@ # along with this program. If not, see . from parameterized import parameterized -from pydictdisplayfilter.factories import SlicerFactory +from pydfql.factories import SlicerFactory from tests import TestCase -from pydictdisplayfilter.parsers import common as pc +from pydfql.parsers import common as pc class TestSliceParser(TestCase): diff --git a/tests/test_sql_display_filter.py b/tests/test_sql_display_filter.py index c93e9f7..6cfa51b 100644 --- a/tests/test_sql_display_filter.py +++ b/tests/test_sql_display_filter.py @@ -1,6 +1,6 @@ # vim: ts=8:sts=8:sw=8:noexpandtab # -# This file is part of python-dict-display-filter. +# This file is part of pydfql. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -20,7 +20,7 @@ from parameterized import parameterized -from pydictdisplayfilter.display_filters import SQLDisplayFilter +from pydfql.display_filters import SQLDisplayFilter class TestSQLDisplayFilter(unittest.TestCase): diff --git a/tests/test_sqlite_display_filter_example.py b/tests/test_sqlite_display_filter_example.py index 3b5217f..ce7170b 100644 --- a/tests/test_sqlite_display_filter_example.py +++ b/tests/test_sqlite_display_filter_example.py @@ -1,6 +1,6 @@ # vim: ts=8:sts=8:sw=8:noexpandtab # -# This file is part of python-dict-display-filter. +# This file is part of pydfql. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/tests/test_table.py b/tests/test_table.py index 765af81..a511599 100644 --- a/tests/test_table.py +++ b/tests/test_table.py @@ -1,6 +1,6 @@ # vim: ts=8:sts=8:sw=8:noexpandtab # -# This file is part of python-dict-display-filter. +# This file is part of pydfql. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -18,7 +18,7 @@ from unittest import TestCase, mock from unittest.mock import Mock, patch -from pydictdisplayfilter.helpers import TableColumnSizeCalculator, Table, DictTable +from pydfql.helpers import TableColumnSizeCalculator, Table, DictTable class TestTable(TestCase):