dukit 0.1.0__tar.gz → 0.2.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {dukit-0.1.0 → dukit-0.2.1}/PKG-INFO +56 -30
- {dukit-0.1.0 → dukit-0.2.1}/README.md +55 -29
- {dukit-0.1.0 → dukit-0.2.1}/pyproject.toml +1 -1
- {dukit-0.1.0 → dukit-0.2.1}/src/dukit/__init__.py +0 -0
- {dukit-0.1.0 → dukit-0.2.1}/src/dukit/_test_utils.py +0 -0
- {dukit-0.1.0 → dukit-0.2.1}/src/dukit/diffing.py +0 -0
- {dukit-0.1.0 → dukit-0.2.1}/src/dukit/excel.py +0 -0
- {dukit-0.1.0 → dukit-0.2.1}/src/dukit/interfaces.py +0 -0
- {dukit-0.1.0 → dukit-0.2.1}/src/dukit/os.py +0 -0
- {dukit-0.1.0 → dukit-0.2.1}/src/dukit/pandas.py +0 -0
- {dukit-0.1.0 → dukit-0.2.1}/src/dukit/py.typed +0 -0
- {dukit-0.1.0 → dukit-0.2.1}/src/dukit/qlang/__init__.py +0 -0
- {dukit-0.1.0 → dukit-0.2.1}/src/dukit/qlang/engine.py +0 -0
- {dukit-0.1.0 → dukit-0.2.1}/src/dukit/qlang/symbols.py +0 -0
- {dukit-0.1.0 → dukit-0.2.1}/src/dukit/typing.py +0 -0
- {dukit-0.1.0 → dukit-0.2.1}/src/dukit/utils.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: dukit
|
|
3
|
-
Version: 0.1
|
|
3
|
+
Version: 0.2.1
|
|
4
4
|
Summary: dukit - data utilities kit for exploring, modifying and visualizing small but messy data using pandas
|
|
5
5
|
Author: MartinVoelkl94
|
|
6
6
|
Author-email: MartinVoelkl94 <martinv16248@gmail.com>
|
|
@@ -12,8 +12,12 @@ Description-Content-Type: text/markdown
|
|
|
12
12
|
|
|
13
13
|
# dukit - data utilities kit
|
|
14
14
|
|
|
15
|
-
Provides utilities focused on data exploration, modification and visualization of small but messy datasets in pandas.
|
|
15
|
+
Provides utilities focused on data exploration, modification and visualization of small but messy datasets in pandas.
|
|
16
16
|
|
|
17
|
+
hosted on github as [dukit](https://github.com/MartinVoelkl94/dukit)
|
|
18
|
+
published on pypi as [dukit](https://pypi.org/project/dukit/)
|
|
19
|
+
<br>
|
|
20
|
+
<br>
|
|
17
21
|
|
|
18
22
|
|
|
19
23
|
# qlang
|
|
@@ -23,9 +27,9 @@ It is implemented as a pandas [accessor extension](https://pandas.pydata.org/doc
|
|
|
23
27
|
|
|
24
28
|
example:
|
|
25
29
|
```python
|
|
26
|
-
|
|
30
|
+
import dukit as dk
|
|
27
31
|
|
|
28
|
-
df = get_df()
|
|
32
|
+
df = dk.get_df()
|
|
29
33
|
|
|
30
34
|
#show all patients with ID > 20000
|
|
31
35
|
df.dk.qs(r'id >20000')
|
|
@@ -46,9 +50,14 @@ df.dk.qs(r'age >18 &&<80 .color(green)')
|
|
|
46
50
|
Take a look at "interactive_demo.ipynb" in the github repo for a quick syntax introduction and more examples.
|
|
47
51
|
|
|
48
52
|
The query language allows for arbitrary code execution via eval(), please be aware of the risks.
|
|
53
|
+
<br>
|
|
54
|
+
<br>
|
|
49
55
|
|
|
50
|
-
Currently published on [testpypi](https://test.pypi.org/project/dukit/).
|
|
51
56
|
|
|
57
|
+
|
|
58
|
+
# dk.diff()
|
|
59
|
+
|
|
60
|
+
Creates colored diff output between two datasets. See interactive_demo.ipynb for examples. Works with pandas dataframes, csv files, excel files and excel files with multiple sheets.
|
|
52
61
|
<br>
|
|
53
62
|
<br>
|
|
54
63
|
|
|
@@ -57,21 +66,33 @@ Currently published on [testpypi](https://test.pypi.org/project/dukit/).
|
|
|
57
66
|
|
|
58
67
|
# other utilities
|
|
59
68
|
|
|
69
|
+
<br>
|
|
70
|
+
<br>
|
|
71
|
+
|
|
60
72
|
|
|
61
|
-
##
|
|
73
|
+
## dk.log()
|
|
62
74
|
|
|
63
75
|
A small logger to be used in notebooks or the REPL. Makes it easier to keep track of outputs in large notebooks by providing color coded output. Does not log to file, but instead to a dataframe which can then be viewed at the end of the notebook.
|
|
64
76
|
<br>
|
|
65
77
|
<br>
|
|
66
78
|
|
|
67
79
|
|
|
68
|
-
## dukit.diff()
|
|
69
80
|
|
|
70
|
-
|
|
81
|
+
## df reshaping
|
|
82
|
+
|
|
83
|
+
these functions offer various ways to deal with non-unique keys/ids.
|
|
84
|
+
primarily used when merging 2 dfs with a one-to-many relationship.
|
|
85
|
+
|
|
86
|
+
available functions:
|
|
87
|
+
- df.dk.flatten()
|
|
88
|
+
- df.dk.stagger()
|
|
89
|
+
- df.dk.embed()
|
|
90
|
+
- df.dk.collapse()
|
|
71
91
|
<br>
|
|
72
92
|
<br>
|
|
73
93
|
|
|
74
94
|
|
|
95
|
+
|
|
75
96
|
## "bashlike" wrappers
|
|
76
97
|
|
|
77
98
|
While python has functions to achieve similar results as common bash commands, they are often more verbose, less intuitive if you are already used to the bash names and spread out over different modules and different namespaces in those modules (os, os.path, shutil, sys, ...).
|
|
@@ -79,35 +100,40 @@ These wrappers use the same names as the bash commands and offer some additional
|
|
|
79
100
|
|
|
80
101
|
|
|
81
102
|
available wrappers:
|
|
82
|
-
-
|
|
83
|
-
-
|
|
84
|
-
-
|
|
85
|
-
-
|
|
86
|
-
-
|
|
87
|
-
-
|
|
88
|
-
-
|
|
89
|
-
-
|
|
90
|
-
-
|
|
103
|
+
- dk.ls()
|
|
104
|
+
- dk.lsr()
|
|
105
|
+
- dk.pwd()
|
|
106
|
+
- dk.cd()
|
|
107
|
+
- dk.cp()
|
|
108
|
+
- dk.mv()
|
|
109
|
+
- dk.mkdir()
|
|
110
|
+
- dk.isdir()
|
|
111
|
+
- dk.isfile()
|
|
112
|
+
- dk.ispath()
|
|
91
113
|
<br>
|
|
92
114
|
<br>
|
|
93
115
|
|
|
94
116
|
|
|
95
|
-
|
|
117
|
+
|
|
118
|
+
## type utilities
|
|
96
119
|
|
|
97
120
|
Mostly wrappers for pandas functions but with some additional functionality and generally more lenient handling of edge cases.
|
|
98
121
|
|
|
99
|
-
available functions:
|
|
100
|
-
-
|
|
101
|
-
-
|
|
102
|
-
-
|
|
103
|
-
-
|
|
104
|
-
-
|
|
105
|
-
-
|
|
106
|
-
-
|
|
107
|
-
-
|
|
108
|
-
-
|
|
109
|
-
-
|
|
110
|
-
-
|
|
122
|
+
available functions/classes:
|
|
123
|
+
- dk.type()
|
|
124
|
+
- dk.convert()
|
|
125
|
+
- dk.str()
|
|
126
|
+
- dk.int()
|
|
127
|
+
- dk.float()
|
|
128
|
+
- dk.num()
|
|
129
|
+
- dk.bool()
|
|
130
|
+
- dk.date()
|
|
131
|
+
- dk.datetime()
|
|
132
|
+
- dk.na()
|
|
133
|
+
- dk.nk()
|
|
134
|
+
- dk.yn()
|
|
135
|
+
- dk.list()
|
|
136
|
+
- dk.Box
|
|
111
137
|
<br>
|
|
112
138
|
<br>
|
|
113
139
|
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
# dukit - data utilities kit
|
|
2
2
|
|
|
3
|
-
Provides utilities focused on data exploration, modification and visualization of small but messy datasets in pandas.
|
|
3
|
+
Provides utilities focused on data exploration, modification and visualization of small but messy datasets in pandas.
|
|
4
4
|
|
|
5
|
+
hosted on github as [dukit](https://github.com/MartinVoelkl94/dukit)
|
|
6
|
+
published on pypi as [dukit](https://pypi.org/project/dukit/)
|
|
7
|
+
<br>
|
|
8
|
+
<br>
|
|
5
9
|
|
|
6
10
|
|
|
7
11
|
# qlang
|
|
@@ -11,9 +15,9 @@ It is implemented as a pandas [accessor extension](https://pandas.pydata.org/doc
|
|
|
11
15
|
|
|
12
16
|
example:
|
|
13
17
|
```python
|
|
14
|
-
|
|
18
|
+
import dukit as dk
|
|
15
19
|
|
|
16
|
-
df = get_df()
|
|
20
|
+
df = dk.get_df()
|
|
17
21
|
|
|
18
22
|
#show all patients with ID > 20000
|
|
19
23
|
df.dk.qs(r'id >20000')
|
|
@@ -34,9 +38,14 @@ df.dk.qs(r'age >18 &&<80 .color(green)')
|
|
|
34
38
|
Take a look at "interactive_demo.ipynb" in the github repo for a quick syntax introduction and more examples.
|
|
35
39
|
|
|
36
40
|
The query language allows for arbitrary code execution via eval(), please be aware of the risks.
|
|
41
|
+
<br>
|
|
42
|
+
<br>
|
|
37
43
|
|
|
38
|
-
Currently published on [testpypi](https://test.pypi.org/project/dukit/).
|
|
39
44
|
|
|
45
|
+
|
|
46
|
+
# dk.diff()
|
|
47
|
+
|
|
48
|
+
Creates colored diff output between two datasets. See interactive_demo.ipynb for examples. Works with pandas dataframes, csv files, excel files and excel files with multiple sheets.
|
|
40
49
|
<br>
|
|
41
50
|
<br>
|
|
42
51
|
|
|
@@ -45,21 +54,33 @@ Currently published on [testpypi](https://test.pypi.org/project/dukit/).
|
|
|
45
54
|
|
|
46
55
|
# other utilities
|
|
47
56
|
|
|
57
|
+
<br>
|
|
58
|
+
<br>
|
|
59
|
+
|
|
48
60
|
|
|
49
|
-
##
|
|
61
|
+
## dk.log()
|
|
50
62
|
|
|
51
63
|
A small logger to be used in notebooks or the REPL. Makes it easier to keep track of outputs in large notebooks by providing color coded output. Does not log to file, but instead to a dataframe which can then be viewed at the end of the notebook.
|
|
52
64
|
<br>
|
|
53
65
|
<br>
|
|
54
66
|
|
|
55
67
|
|
|
56
|
-
## dukit.diff()
|
|
57
68
|
|
|
58
|
-
|
|
69
|
+
## df reshaping
|
|
70
|
+
|
|
71
|
+
these functions offer various ways to deal with non-unique keys/ids.
|
|
72
|
+
primarily used when merging 2 dfs with a one-to-many relationship.
|
|
73
|
+
|
|
74
|
+
available functions:
|
|
75
|
+
- df.dk.flatten()
|
|
76
|
+
- df.dk.stagger()
|
|
77
|
+
- df.dk.embed()
|
|
78
|
+
- df.dk.collapse()
|
|
59
79
|
<br>
|
|
60
80
|
<br>
|
|
61
81
|
|
|
62
82
|
|
|
83
|
+
|
|
63
84
|
## "bashlike" wrappers
|
|
64
85
|
|
|
65
86
|
While python has functions to achieve similar results as common bash commands, they are often more verbose, less intuitive if you are already used to the bash names and spread out over different modules and different namespaces in those modules (os, os.path, shutil, sys, ...).
|
|
@@ -67,35 +88,40 @@ These wrappers use the same names as the bash commands and offer some additional
|
|
|
67
88
|
|
|
68
89
|
|
|
69
90
|
available wrappers:
|
|
70
|
-
-
|
|
71
|
-
-
|
|
72
|
-
-
|
|
73
|
-
-
|
|
74
|
-
-
|
|
75
|
-
-
|
|
76
|
-
-
|
|
77
|
-
-
|
|
78
|
-
-
|
|
91
|
+
- dk.ls()
|
|
92
|
+
- dk.lsr()
|
|
93
|
+
- dk.pwd()
|
|
94
|
+
- dk.cd()
|
|
95
|
+
- dk.cp()
|
|
96
|
+
- dk.mv()
|
|
97
|
+
- dk.mkdir()
|
|
98
|
+
- dk.isdir()
|
|
99
|
+
- dk.isfile()
|
|
100
|
+
- dk.ispath()
|
|
79
101
|
<br>
|
|
80
102
|
<br>
|
|
81
103
|
|
|
82
104
|
|
|
83
|
-
|
|
105
|
+
|
|
106
|
+
## type utilities
|
|
84
107
|
|
|
85
108
|
Mostly wrappers for pandas functions but with some additional functionality and generally more lenient handling of edge cases.
|
|
86
109
|
|
|
87
|
-
available functions:
|
|
88
|
-
-
|
|
89
|
-
-
|
|
90
|
-
-
|
|
91
|
-
-
|
|
92
|
-
-
|
|
93
|
-
-
|
|
94
|
-
-
|
|
95
|
-
-
|
|
96
|
-
-
|
|
97
|
-
-
|
|
98
|
-
-
|
|
110
|
+
available functions/classes:
|
|
111
|
+
- dk.type()
|
|
112
|
+
- dk.convert()
|
|
113
|
+
- dk.str()
|
|
114
|
+
- dk.int()
|
|
115
|
+
- dk.float()
|
|
116
|
+
- dk.num()
|
|
117
|
+
- dk.bool()
|
|
118
|
+
- dk.date()
|
|
119
|
+
- dk.datetime()
|
|
120
|
+
- dk.na()
|
|
121
|
+
- dk.nk()
|
|
122
|
+
- dk.yn()
|
|
123
|
+
- dk.list()
|
|
124
|
+
- dk.Box
|
|
99
125
|
<br>
|
|
100
126
|
<br>
|
|
101
127
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|