Skip to content

Commit b45b340

Browse files
committed
#9 Rebranding
1 parent de39123 commit b45b340

34 files changed

+166
-154
lines changed

.github/workflows/codecov.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Workflow for Codecov python-dict-display-filter
1+
name: Workflow for Codecov pydfql
22
on: [push, pull_request]
33
jobs:
44
run:

README.md

+44-38
Original file line numberDiff line numberDiff line change
@@ -1,59 +1,71 @@
11
<p align="center">
2-
<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"/>
2+
<img src="https://github.com/bytebutcher/pydfql/raw/main/images/pydfql_logo.png" alt="pydfql Logo"/>
33
</p>
4-
<h1 align="center" style="margin-top: 0px;">Python Dictionary Display Filter</h1>
4+
<h1 align="center" style="margin-top: 0px;">Python Display Filter Query Language</h1>
55
<div align="center">
66

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

15-
A Wireshark-like display filter for Python dictionaries and various other data
16-
sources, including objects, lists, and SQL databases.
15+
A Wireshark-like display filter various data formats, including Python dictionaries, lists, objects, and SQL databases.
1716

1817
## Table of Contents
1918
1. [Quick Start](#quick-start)
20-
2. [Features](#features)
21-
3. [Examples](#examples)
22-
4. [Acknowledgements](#acknowledgements)
19+
20+
1.1 [Installation](#installation)
21+
22+
1.2 [Initialization](#initialization)
23+
24+
1.3 [Filtering Data](#filtering-data)
25+
26+
2. [Examples](#examples)
27+
3. [Acknowledgements](#acknowledgements)
2328

2429
## Quick Start
2530

26-
To quickly get started with the python-dictionary-display-filter, follow the steps below:
31+
To quickly get started follow the steps below:
2732

2833
### Installation
2934
First, install the package using pip:
3035

3136
```commandline
32-
pip3 install python-dict-display-filter
37+
pip3 install pydfql
3338
```
3439

3540
### Initialization
36-
Next, import the necessary module and initialize the ```DictDisplayFilter``` with a list of dictionaries:
41+
Next, import the necessary module and initialize the appropriate display filter with some data.
42+
In the example below we are initializing the ```ObjectDisplayFilter``` with a list of objects:
3743
```python
38-
from pydictdisplayfilter import DictDisplayFilter
44+
from pydfql import ObjectDisplayFilter
45+
46+
class Actor:
47+
def __init__(self, name, age, gender):
48+
self.name = name
49+
self.age = age
50+
self.gender = gender
3951

4052
actors = [
41-
{"name": ["Laurence", "Fishburne"], "age": {"born": "1961"}, "gender": "male"},
42-
{"name": ["Keanu", "Reeves"], "age": {"born": "1964"}, "gender": "male", "power": ["flight", "bullet-time"]},
43-
{"name": ["Joe", "Pantoliano"], "age": {"born": "1951"}, "gender": "male"},
44-
{"name": ["Carrie-Anne", "Moss"], "age": {"born": "1967"}, "gender": "female"}
53+
Actor(["Laurence", "Fishburne"], {"born": "1961"}, "male"),
54+
Actor(["Keanu", "Reeves"], {"born": "1964"}, "male"),
55+
Actor(["Joe", "Pantoliano"], {"born": "1951"}, "male"),
56+
Actor(["Carrie-Anne", "Moss"], {"born": "1967"}, "female")
4557
]
4658

47-
ddf = DictDisplayFilter(actors)
59+
df = ObjectDisplayFilter(actors)
4860
```
4961

5062
### Filtering Data
51-
Once the ```DictDisplayFilter``` is initialized, you can start filtering the data using the
52-
<a href="https://github.com/bytebutcher/python-dict-display-filter/blob/main/docs/USER_GUIDE.md#4-query-language">display filter query language</a>.
63+
Once the display filter is initialized, you can start filtering the data using the
64+
<a href="https://github.com/bytebutcher/pydfql/blob/main/docs/USER_GUIDE.md#4-query-language">display filter query language</a>.
5365
For example, let's filter the actors whose birth year is after 1960:
5466
```python
5567
filter_query = "age.born > 1960"
56-
filtered_data = ddf.filter(filter_query)
68+
filtered_data = df.filter(filter_query)
5769
print(list(filtered_data))
5870
[
5971
{"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
6779

6880
```python
6981
filter_query = "gender == male and (age.born > 1960 and age.born < 1965) and name matches .*e$"
70-
filtered_data = ddf.filter(filter_query)
82+
filtered_data = df.filter(filter_query)
7183
print(list(filtered_data))
7284
```
7385

@@ -76,32 +88,26 @@ This will output the filtered data:
7688
[{'name': ['Laurence', 'Fishburne'], 'age': {'born': '1961'}, 'gender': 'male'}]
7789
```
7890

79-
For more details and advanced usage, please refer to the
80-
<a href="https://github.com/bytebutcher/python-dict-display-filter/blob/main/docs/USER_GUIDE.md">User Guide</a>.
81-
82-
## Features
83-
84-
Python Dictionary Display Filter supports a wide range of features, including:
91+
Overall, PyDFQL supports a wide range of features, including:
92+
* **Data Types**: ```Dictionaries```, ```Lists```, ```Objects```, ```SQL```
8593
* **Comparison Operators:** ```==```, ```!=```, ```<=```, ```<```, ```>=```, ```>```, ```~=```, ```~```, ```&```
8694
* **Combining Operators:** ```and```, ```or```, ```xor```, ```not```
8795
* **Membership Operators:** ```in```
8896
* **Types:** ```Text```, ```Number```, ```Date & Time```, ```Ethernet-```, ```IPv4-```, ```IPv6-Address```
8997
* **Slicing:** ```Text```, ```Ethernet-```, ```IPv4-```, ```IPv6-Address```
9098
* **Functions:** ```upper```, ```lower```, ```len```
91-
* **Data Sources**: ```CSV```, ```Dictionaries```, ```JSON```, ```Objects```, ```SQLite```
9299

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

96103
## Examples
97104

98-
For detailed examples of how the display filter can be utilized, please refer to the following sections of the
99-
<a href="https://github.com/bytebutcher/python-dict-display-filter/blob/main/docs/USER_GUIDE.md">User Guide</a>:
105+
For detailed examples of how the display filter can be utilized, please refer to the following:
100106

101-
* [CSV Display Filter](https://github.com/bytebutcher/python-dict-display-filter/blob/main/docs/USER_GUIDE.md#51-csv-display-filter)
102-
* [JSON Display Filter](https://github.com/bytebutcher/python-dict-display-filter/blob/main/docs/USER_GUIDE.md#52-json-display-filter)
103-
* [SQLite Display Filter](https://github.com/bytebutcher/python-dict-display-filter/blob/main/docs/USER_GUIDE.md#53-sqlite-display-filter)
104-
* [Nmap Display Filter](https://github.com/bytebutcher/python-dict-display-filter/blob/main/docs/USER_GUIDE.md#54-nmap-display-filter)
107+
* [CSV Display Filter](https://github.com/bytebutcher/pydfql/blob/main/docs/USER_GUIDE.md#51-csv-display-filter)
108+
* [JSON Display Filter](https://github.com/bytebutcher/pydfql/blob/main/docs/USER_GUIDE.md#52-json-display-filter)
109+
* [SQLite Display Filter](https://github.com/bytebutcher/pydfql/blob/main/docs/USER_GUIDE.md#53-sqlite-display-filter)
110+
* [Nmap Display Filter](https://github.com/bytebutcher/pydfql/blob/main/docs/USER_GUIDE.md#54-nmap-display-filter)
105111

106112
## Acknowledgements
107113

docs/DEVELOPER_GUIDE.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<p align="center">
2-
<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"/>
2+
<img src="https://github.com/bytebutcher/pydfql/raw/main/images/pydfql_logo.png" alt="pydfql Logo"/>
33
</p>
4-
<h1 align="center" style="margin-top: 0px;">Python Dictionary Display Filter</br>Developer Guide</h1>
4+
<h1 align="center" style="margin-top: 0px;">Python Display Filter Query Language</br>Developer Guide</h1>
55
<br>
66

77
## Customizing Display Filters
@@ -19,7 +19,7 @@ parameters:
1919

2020
## Exceptions
2121

22-
The ```python-dict-display-filter``` defines some custom exceptions which may be thrown during runtime:
22+
```pydfql``` defines some custom exceptions which may be thrown during runtime:
2323

2424
| Exception | Description |
2525
|------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
@@ -29,7 +29,7 @@ The ```python-dict-display-filter``` defines some custom exceptions which may be
2929

3030
## Helpers
3131

32-
The ```python-dict-display-filter``` defines a set of helpers which may be used in standalone applications:
32+
```pydfql``` defines a set of helpers which may be used in standalone applications:
3333

3434
| Helper Class | Description |
3535
|------------------------------|---------------------------------------------------------------------------------------------------------------------------------|

docs/USER_GUIDE.md

+45-39
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<p align="center">
2-
<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"/>
2+
<img src="https://github.com/bytebutcher/pydfql/raw/main/images/pydfql_logo.png" alt="pydfql Logo"/>
33
</p>
4-
<h1 align="center" style="margin-top: 0px;">Python Dictionary Display Filter</br>User Guide</h1>
4+
<h1 align="center" style="margin-top: 0px;">Python Display Filter Query Language</br>User Guide</h1>
55
<br>
66

77
## Table of Contents
@@ -50,46 +50,47 @@
5050

5151
## 1. Introduction
5252

53-
The Python Dictionary Display Filter library allows filtering data using a custom
53+
The Python Display Filter Query Language allows filtering data using a Wireshark-like
5454
query language. It provides a flexible and efficient way to extract specific information from various data
55-
sources, including dictionaries, objects, lists, and SQL databases.
55+
formats, including dictionaries, objects, lists, and SQL databases.
5656

57-
In this user guide, we will explore the installation process, an overview of how to work with various data sources,
58-
a detailed explanation of the query language, and practical examples to demonstrate real-world usage.
57+
In this user guide, we will explore the installation process, provide an overview of how to work with various data
58+
formats, give a detailed explanation of the query language, and provide practical examples to demonstrate real-world
59+
usage.
5960

6061
By the end of this guide, you will have a comprehensive understanding of the
61-
Python Dictionary Display Filter and be equipped to effectively filter and extract the data you need
62+
Python Display Filter Query Language and be equipped to effectively filter and extract the data you need
6263
from diverse sources.
6364

6465
## 2. Installation
6566

66-
To install the Python Dictionary Display Filter, you can use the pip package manager.
67+
To install ```pydfql``, you can use the pip package manager.
6768
Open your terminal or command prompt and run the following command:
6869
```commandline
69-
pip3 install python-dict-display-filter
70+
pip3 install pydfql
7071
```
7172

72-
Now that you have installed the python-dictionary-display-filter application,
73+
Now that you have installed ```pydfql```,
7374
let's move on to the next section and explore how to quickly get started with it.
7475

7576
## 3. Usage
7677

77-
The Python Dictionary Display Filter library provides support for filtering data from various sources.
78-
While the name may suggest that it primarily works with dictionaries, it actually supports other kinds of data sources
79-
as well. This section will provide an overview of how the Display Filter can be used for different data sources.
78+
The ```pydfql``` library provides support for filtering data from various sources.
79+
This section will provide an overview of how ```pydfql``` can be used for different data sources.
8080

8181
### 3.1 DictDisplayFilter
8282
The ```DictDisplayFilter``` allows to filter a list of dictionaries.
8383

8484
**Example:**
85+
8586
```python
86-
from pydictdisplayfilter import DictDisplayFilter
87+
from pydfql import DictDisplayFilter
8788

8889
actors = [
89-
{"name": ["Laurence", "Fishburne"], "age": {"born": "1961"}, "gender": "male"},
90-
{"name": ["Keanu", "Reeves"], "age": {"born": "1964"}, "gender": "male", "power": ["flight", "bullet-time"]},
91-
{"name": ["Joe", "Pantoliano"], "age": {"born": "1951"}, "gender": "male"},
92-
{"name": ["Carrie-Anne", "Moss"], "age": {"born": "1967"}, "gender": "female"}
90+
{"name": ["Laurence", "Fishburne"], "age": {"born": "1961"}, "gender": "male"},
91+
{"name": ["Keanu", "Reeves"], "age": {"born": "1964"}, "gender": "male", "power": ["flight", "bullet-time"]},
92+
{"name": ["Joe", "Pantoliano"], "age": {"born": "1951"}, "gender": "male"},
93+
{"name": ["Carrie-Anne", "Moss"], "age": {"born": "1967"}, "gender": "female"}
9394
]
9495

9596
filter_query = "age.born > 1960 and age.born < 1965"
@@ -101,20 +102,23 @@ print(list(filtered_data))
101102
The ```ObjectDisplayFilter``` enables filtering a list of objects.
102103

103104
**Example:**
105+
104106
```python
105-
from pydictdisplayfilter import ObjectDisplayFilter
107+
from pydfql import ObjectDisplayFilter
108+
106109

107110
class Actor:
108-
def __init__(self, name, age, gender):
109-
self.name = name
110-
self.age = age
111-
self.gender = gender
111+
def __init__(self, name, age, gender):
112+
self.name = name
113+
self.age = age
114+
self.gender = gender
115+
112116

113117
actors = [
114-
Actor(["Laurence", "Fishburne"], {"born": "1961"}, "male"),
115-
Actor(["Keanu", "Reeves"], {"born": "1964"}, "male"),
116-
Actor(["Joe", "Pantoliano"], {"born": "1951"}, "male"),
117-
Actor(["Carrie-Anne", "Moss"], {"born": "1967"}, "female")
118+
Actor(["Laurence", "Fishburne"], {"born": "1961"}, "male"),
119+
Actor(["Keanu", "Reeves"], {"born": "1964"}, "male"),
120+
Actor(["Joe", "Pantoliano"], {"born": "1951"}, "male"),
121+
Actor(["Carrie-Anne", "Moss"], {"born": "1967"}, "female")
118122
]
119123

120124
filter_query = "age.born > 1960"
@@ -127,14 +131,15 @@ print(list(filtered_data))
127131
The ```ListDisplayFilter``` allows filtering a list of lists.
128132

129133
**Example:**
134+
130135
```python
131-
from pydictdisplayfilter import ListDisplayFilter
136+
from pydfql import ListDisplayFilter
132137

133138
data = [
134-
["Morpheus", "Laurence Fishburne", 38, "male", False],
135-
["Neo", "Keanu Reeves", 35, "male", False],
136-
["Cipher", "Joe Pantoliano", 48, "male", True],
137-
["Trinity", "Carrie-Anne Moss", 32, "female", False]
139+
["Morpheus", "Laurence Fishburne", 38, "male", False],
140+
["Neo", "Keanu Reeves", 35, "male", False],
141+
["Cipher", "Joe Pantoliano", 48, "male", True],
142+
["Trinity", "Carrie-Anne Moss", 32, "female", False]
138143
]
139144

140145
filter_query = "age < 40"
@@ -148,8 +153,9 @@ print(filtered_data)
148153
The ```SQLDisplayFilter``` allows filtering a SQL database table.
149154

150155
**Example:**
156+
151157
```python
152-
from pydictdisplayfilter import SQLDisplayFilter
158+
from pydfql import SQLDisplayFilter
153159
import sqlite3
154160

155161
database_file = './data/sqlite_example.sqlite'
@@ -163,7 +169,7 @@ print(filtered_data)
163169

164170
## 4. Query Language
165171

166-
The query language in the python-dict-display-filter library provides a wide range of operations, comparisons, and
172+
The query language provides a wide range of operations, comparisons, and
167173
logical operators to help retrieving the desired subset of data.
168174
This section introduces the query language and its components, including fields, comparisons, field types,
169175
combining expressions, slice operator, membership operator, and functions.
@@ -401,7 +407,7 @@ The display filter language has a number of functions to convert fields:
401407
## 5. Examples
402408

403409
In this section, we will walk through various examples to demonstrate the practical usage of the
404-
python-dictionary-display-filter.
410+
```pydfql```.
405411

406412
### 5.1 CSV Display Filter
407413

@@ -428,7 +434,7 @@ Neo | 35 | male | False
428434
1 row in set (0.01 secs)
429435
```
430436

431-
See <a href="https://github.com/bytebutcher/python-dict-display-filter/raw/main/examples/csv_display_filter.py">examples/csv_display_filter.py</a> for implementation details.
437+
See <a href="https://github.com/bytebutcher/pydfql/raw/main/examples/csv_display_filter.py">examples/csv_display_filter.py</a> for implementation details.
432438

433439

434440
### 5.2 JSON Display Filter
@@ -453,7 +459,7 @@ age.born
453459
1 row in set (0.01 secs)
454460
```
455461

456-
See <a href="https://github.com/bytebutcher/python-dict-display-filter/raw/main/examples/json_display_filter.py">examples/json_display_filter.py</a> for implementation details.
462+
See <a href="https://github.com/bytebutcher/pydfql/raw/main/examples/json_display_filter.py">examples/json_display_filter.py</a> for implementation details.
457463

458464
### 5.3 Nmap Display Filter
459465

@@ -495,7 +501,7 @@ host | port | protocol | status | service
495501
6 rows in set (0.01 secs)
496502
```
497503

498-
See <a href="https://github.com/bytebutcher/python-dict-display-filter/raw/main/examples/nmap_display_filter.py">examples/nmap_display_filter.py</a> for implementation details.
504+
See <a href="https://github.com/bytebutcher/pydfql/raw/main/examples/nmap_display_filter.py">examples/nmap_display_filter.py</a> for implementation details.
499505

500506
### 5.4 SQLite Display Filter
501507

@@ -531,7 +537,7 @@ Neo | Keanu Reeves | 35 | male | 0
531537
1 row in set (0.01 secs)
532538
```
533539

534-
See <a href="https://github.com/bytebutcher/python-dict-display-filter/raw/main/examples/sqlite_display_filter.py">examples/sqlite_display_filter.py</a> for implementation details.
540+
See <a href="https://github.com/bytebutcher/pydfql/raw/main/examples/sqlite_display_filter.py">examples/sqlite_display_filter.py</a> for implementation details.
535541

536542

537543
## 6. Acknowledgements

examples/csv_display_filter.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# vim: ts=8:sts=8:sw=8:noexpandtab
22
#
3-
# This file is part of python-dict-display-filter.
3+
# This file is part of pydfql.
44
#
55
# This program is free software; you can redistribute it and/or modify
66
# it under the terms of the GNU General Public License as published by
@@ -21,7 +21,7 @@
2121
import sys
2222
import traceback
2323

24-
from pydictdisplayfilter.helpers import DictDisplayFilterShell
24+
from pydfql.helpers import DictDisplayFilterShell
2525

2626

2727
def read_csv_file(csv_file):

0 commit comments

Comments
 (0)