python-jack-knife 0.7.5__tar.gz → 0.7.6__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.
- {python_jack_knife-0.7.5 → python_jack_knife-0.7.6}/PKG-INFO +4 -1
- {python_jack_knife-0.7.5 → python_jack_knife-0.7.6}/pyproject.toml +1 -1
- {python_jack_knife-0.7.5 → python_jack_knife-0.7.6}/src/pjk/integrations/opensearch_client.py +6 -6
- {python_jack_knife-0.7.5 → python_jack_knife-0.7.6}/src/pjk/usage.py +59 -10
- {python_jack_knife-0.7.5 → python_jack_knife-0.7.6}/src/pjk/version.py +1 -1
- {python_jack_knife-0.7.5 → python_jack_knife-0.7.6}/src/python_jack_knife.egg-info/PKG-INFO +4 -1
- {python_jack_knife-0.7.5 → python_jack_knife-0.7.6}/src/python_jack_knife.egg-info/requires.txt +3 -0
- {python_jack_knife-0.7.5 → python_jack_knife-0.7.6}/LICENSE +0 -0
- {python_jack_knife-0.7.5 → python_jack_knife-0.7.6}/README.md +0 -0
- {python_jack_knife-0.7.5 → python_jack_knife-0.7.6}/setup.cfg +0 -0
- {python_jack_knife-0.7.5 → python_jack_knife-0.7.6}/src/pjk/__init__.py +0 -0
- {python_jack_knife-0.7.5 → python_jack_knife-0.7.6}/src/pjk/common.py +0 -0
- {python_jack_knife-0.7.5 → python_jack_knife-0.7.6}/src/pjk/components.py +0 -0
- {python_jack_knife-0.7.5 → python_jack_knife-0.7.6}/src/pjk/engine.py +0 -0
- {python_jack_knife-0.7.5 → python_jack_knife-0.7.6}/src/pjk/history.py +0 -0
- {python_jack_knife-0.7.5 → python_jack_knife-0.7.6}/src/pjk/integrations/opensearch_index_sink.py +0 -0
- {python_jack_knife-0.7.5 → python_jack_knife-0.7.6}/src/pjk/integrations/opensearch_query_pipe.py +0 -0
- {python_jack_knife-0.7.5 → python_jack_knife-0.7.6}/src/pjk/integrations/postgres_pipe.py +0 -0
- {python_jack_knife-0.7.5 → python_jack_knife-0.7.6}/src/pjk/integrations/snowflake_pipe.py +0 -0
- {python_jack_knife-0.7.5 → python_jack_knife-0.7.6}/src/pjk/log.py +0 -0
- {python_jack_knife-0.7.5 → python_jack_knife-0.7.6}/src/pjk/main.py +0 -0
- {python_jack_knife-0.7.5 → python_jack_knife-0.7.6}/src/pjk/man_page.py +0 -0
- {python_jack_knife-0.7.5 → python_jack_knife-0.7.6}/src/pjk/parse_pjk_file.py +0 -0
- {python_jack_knife-0.7.5 → python_jack_knife-0.7.6}/src/pjk/parser.py +0 -0
- {python_jack_knife-0.7.5 → python_jack_knife-0.7.6}/src/pjk/pipes/__init__.py +0 -0
- {python_jack_knife-0.7.5 → python_jack_knife-0.7.6}/src/pjk/pipes/ddiff.py +0 -0
- {python_jack_knife-0.7.5 → python_jack_knife-0.7.6}/src/pjk/pipes/denorm.py +0 -0
- {python_jack_knife-0.7.5 → python_jack_knife-0.7.6}/src/pjk/pipes/factory.py +0 -0
- {python_jack_knife-0.7.5 → python_jack_knife-0.7.6}/src/pjk/pipes/filter.py +0 -0
- {python_jack_knife-0.7.5 → python_jack_knife-0.7.6}/src/pjk/pipes/head.py +0 -0
- {python_jack_knife-0.7.5 → python_jack_knife-0.7.6}/src/pjk/pipes/join.py +0 -0
- {python_jack_knife-0.7.5 → python_jack_knife-0.7.6}/src/pjk/pipes/let_reduce.py +0 -0
- {python_jack_knife-0.7.5 → python_jack_knife-0.7.6}/src/pjk/pipes/map.py +0 -0
- {python_jack_knife-0.7.5 → python_jack_knife-0.7.6}/src/pjk/pipes/move_field.py +0 -0
- {python_jack_knife-0.7.5 → python_jack_knife-0.7.6}/src/pjk/pipes/progress_pipe.py +0 -0
- {python_jack_knife-0.7.5 → python_jack_knife-0.7.6}/src/pjk/pipes/query_pipe.py +0 -0
- {python_jack_knife-0.7.5 → python_jack_knife-0.7.6}/src/pjk/pipes/remove_field.py +0 -0
- {python_jack_knife-0.7.5 → python_jack_knife-0.7.6}/src/pjk/pipes/sample.py +0 -0
- {python_jack_knife-0.7.5 → python_jack_knife-0.7.6}/src/pjk/pipes/select.py +0 -0
- {python_jack_knife-0.7.5 → python_jack_knife-0.7.6}/src/pjk/pipes/sort.py +0 -0
- {python_jack_knife-0.7.5 → python_jack_knife-0.7.6}/src/pjk/pipes/tail.py +0 -0
- {python_jack_knife-0.7.5 → python_jack_knife-0.7.6}/src/pjk/pipes/user_pipe_factory.py +0 -0
- {python_jack_knife-0.7.5 → python_jack_knife-0.7.6}/src/pjk/pipes/where.py +0 -0
- {python_jack_knife-0.7.5 → python_jack_knife-0.7.6}/src/pjk/progress.py +0 -0
- {python_jack_knife-0.7.5 → python_jack_knife-0.7.6}/src/pjk/registry.py +0 -0
- {python_jack_knife-0.7.5 → python_jack_knife-0.7.6}/src/pjk/sinks/__init__.py +0 -0
- {python_jack_knife-0.7.5 → python_jack_knife-0.7.6}/src/pjk/sinks/create_sink.py +0 -0
- {python_jack_knife-0.7.5 → python_jack_knife-0.7.6}/src/pjk/sinks/csv_sink.py +0 -0
- {python_jack_knife-0.7.5 → python_jack_knife-0.7.6}/src/pjk/sinks/devnull.py +0 -0
- {python_jack_knife-0.7.5 → python_jack_knife-0.7.6}/src/pjk/sinks/dir_sink.py +0 -0
- {python_jack_knife-0.7.5 → python_jack_knife-0.7.6}/src/pjk/sinks/expect.py +0 -0
- {python_jack_knife-0.7.5 → python_jack_knife-0.7.6}/src/pjk/sinks/factory.py +0 -0
- {python_jack_knife-0.7.5 → python_jack_knife-0.7.6}/src/pjk/sinks/format_sink.py +0 -0
- {python_jack_knife-0.7.5 → python_jack_knife-0.7.6}/src/pjk/sinks/graph.py +0 -0
- {python_jack_knife-0.7.5 → python_jack_knife-0.7.6}/src/pjk/sinks/graph_axis.py +0 -0
- {python_jack_knife-0.7.5 → python_jack_knife-0.7.6}/src/pjk/sinks/graph_bar_line.py +0 -0
- {python_jack_knife-0.7.5 → python_jack_knife-0.7.6}/src/pjk/sinks/graph_cumulative.py +0 -0
- {python_jack_knife-0.7.5 → python_jack_knife-0.7.6}/src/pjk/sinks/graph_hist.py +0 -0
- {python_jack_knife-0.7.5 → python_jack_knife-0.7.6}/src/pjk/sinks/graph_scatter.py +0 -0
- {python_jack_knife-0.7.5 → python_jack_knife-0.7.6}/src/pjk/sinks/json_sink.py +0 -0
- {python_jack_knife-0.7.5 → python_jack_knife-0.7.6}/src/pjk/sinks/s3_sink.py +0 -0
- {python_jack_knife-0.7.5 → python_jack_knife-0.7.6}/src/pjk/sinks/s3_stream.py +0 -0
- {python_jack_knife-0.7.5 → python_jack_knife-0.7.6}/src/pjk/sinks/sinks.py +0 -0
- {python_jack_knife-0.7.5 → python_jack_knife-0.7.6}/src/pjk/sinks/stdout.py +0 -0
- {python_jack_knife-0.7.5 → python_jack_knife-0.7.6}/src/pjk/sinks/tsv_sink.py +0 -0
- {python_jack_knife-0.7.5 → python_jack_knife-0.7.6}/src/pjk/sinks/user_sink_factory.py +0 -0
- {python_jack_knife-0.7.5 → python_jack_knife-0.7.6}/src/pjk/sources/__init__.py +0 -0
- {python_jack_knife-0.7.5 → python_jack_knife-0.7.6}/src/pjk/sources/csv_source.py +0 -0
- {python_jack_knife-0.7.5 → python_jack_knife-0.7.6}/src/pjk/sources/dict_list_source.py +0 -0
- {python_jack_knife-0.7.5 → python_jack_knife-0.7.6}/src/pjk/sources/dir_source.py +0 -0
- {python_jack_knife-0.7.5 → python_jack_knife-0.7.6}/src/pjk/sources/factory.py +0 -0
- {python_jack_knife-0.7.5 → python_jack_knife-0.7.6}/src/pjk/sources/favorite_source.py +0 -0
- {python_jack_knife-0.7.5 → python_jack_knife-0.7.6}/src/pjk/sources/format_source.py +0 -0
- {python_jack_knife-0.7.5 → python_jack_knife-0.7.6}/src/pjk/sources/http_source.py +0 -0
- {python_jack_knife-0.7.5 → python_jack_knife-0.7.6}/src/pjk/sources/inline_source.py +0 -0
- {python_jack_knife-0.7.5 → python_jack_knife-0.7.6}/src/pjk/sources/json_source.py +0 -0
- {python_jack_knife-0.7.5 → python_jack_knife-0.7.6}/src/pjk/sources/lazy_file.py +0 -0
- {python_jack_knife-0.7.5 → python_jack_knife-0.7.6}/src/pjk/sources/lazy_file_local.py +0 -0
- {python_jack_knife-0.7.5 → python_jack_knife-0.7.6}/src/pjk/sources/lazy_file_s3.py +0 -0
- {python_jack_knife-0.7.5 → python_jack_knife-0.7.6}/src/pjk/sources/npy_source.py +0 -0
- {python_jack_knife-0.7.5 → python_jack_knife-0.7.6}/src/pjk/sources/parquet_source.py +0 -0
- {python_jack_knife-0.7.5 → python_jack_knife-0.7.6}/src/pjk/sources/s3_select_source.py +0 -0
- {python_jack_knife-0.7.5 → python_jack_knife-0.7.6}/src/pjk/sources/s3_source.py +0 -0
- {python_jack_knife-0.7.5 → python_jack_knife-0.7.6}/src/pjk/sources/source_list.py +0 -0
- {python_jack_knife-0.7.5 → python_jack_knife-0.7.6}/src/pjk/sources/sql_source.py +0 -0
- {python_jack_knife-0.7.5 → python_jack_knife-0.7.6}/src/pjk/sources/tsv_source.py +0 -0
- {python_jack_knife-0.7.5 → python_jack_knife-0.7.6}/src/pjk/sources/user_source_factory.py +0 -0
- {python_jack_knife-0.7.5 → python_jack_knife-0.7.6}/src/python_jack_knife.egg-info/SOURCES.txt +0 -0
- {python_jack_knife-0.7.5 → python_jack_knife-0.7.6}/src/python_jack_knife.egg-info/dependency_links.txt +0 -0
- {python_jack_knife-0.7.5 → python_jack_knife-0.7.6}/src/python_jack_knife.egg-info/entry_points.txt +0 -0
- {python_jack_knife-0.7.5 → python_jack_knife-0.7.6}/src/python_jack_knife.egg-info/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: python-jack-knife
|
|
3
|
-
Version: 0.7.
|
|
3
|
+
Version: 0.7.6
|
|
4
4
|
Summary: Python Jack Knife – a command line data processor
|
|
5
5
|
Author-email: Mike Schultz <mike.schultz@gmail.com>
|
|
6
6
|
License:
|
|
@@ -226,6 +226,9 @@ Provides-Extra: dev
|
|
|
226
226
|
Requires-Dist: pytest; extra == "dev"
|
|
227
227
|
Requires-Dist: black; extra == "dev"
|
|
228
228
|
Requires-Dist: ruff; extra == "dev"
|
|
229
|
+
Requires-Dist: build; extra == "dev"
|
|
230
|
+
Requires-Dist: twine; extra == "dev"
|
|
231
|
+
Requires-Dist: opensearch-py; extra == "dev"
|
|
229
232
|
Provides-Extra: all
|
|
230
233
|
Requires-Dist: boto3>=1.34; extra == "all"
|
|
231
234
|
Requires-Dist: pg8000>=1.30.0; extra == "all"
|
|
@@ -25,7 +25,7 @@ aws = ["boto3>=1.34"]
|
|
|
25
25
|
postgres = ["pg8000>=1.30.0"]
|
|
26
26
|
parquet = ["pyarrow>=15.0.0"]
|
|
27
27
|
plot = ["matplotlib>=3.9.0", "pandas>=2.2.0"]
|
|
28
|
-
dev = ["pytest", "black", "ruff"]
|
|
28
|
+
dev = ["pytest", "black", "ruff", "build", "twine", "opensearch-py"]
|
|
29
29
|
all = [
|
|
30
30
|
"boto3>=1.34",
|
|
31
31
|
"pg8000>=1.30.0",
|
{python_jack_knife-0.7.5 → python_jack_knife-0.7.6}/src/pjk/integrations/opensearch_client.py
RENAMED
|
@@ -2,20 +2,20 @@ from pjk.usage import Usage
|
|
|
2
2
|
|
|
3
3
|
# name, type, default
|
|
4
4
|
OS_CONFIG_TUPLES = [
|
|
5
|
-
("default_index", str, None),
|
|
5
|
+
("default_index", str, None, True),
|
|
6
6
|
("os_auth_use_aws", bool, "true"),
|
|
7
7
|
("os_scheme", str, "https"),
|
|
8
8
|
("os_verify_certs", bool, "true"),
|
|
9
|
-
("os_ca_certs", str, None),
|
|
10
|
-
("os_region", str, None),
|
|
9
|
+
("os_ca_certs", str, None, True),
|
|
10
|
+
("os_region", str, None, True),
|
|
11
11
|
("os_service", str, "es"),
|
|
12
|
-
("os_username", str, None),
|
|
13
|
-
("os_password", str, None),
|
|
12
|
+
("os_username", str, None, True),
|
|
13
|
+
("os_password", str, None, True),
|
|
14
14
|
("os_timeout", float, 30),
|
|
15
15
|
("os_ssl_assert_hostname", bool, "true"),
|
|
16
16
|
("os_ssl_show_warn", bool, "false"),
|
|
17
17
|
("os_host", str, None),
|
|
18
|
-
("os_port", int, None)
|
|
18
|
+
("os_port", int, None, True),
|
|
19
19
|
]
|
|
20
20
|
|
|
21
21
|
class OpenSearchClient:
|
|
@@ -3,6 +3,7 @@ import os
|
|
|
3
3
|
import yaml
|
|
4
4
|
|
|
5
5
|
CONFIG_FILE = '~/.pjk/configs.yaml'
|
|
6
|
+
EXTENDS_KEY = '_extends'
|
|
6
7
|
|
|
7
8
|
class Config:
|
|
8
9
|
def __init__(self):
|
|
@@ -17,6 +18,43 @@ class Config:
|
|
|
17
18
|
else:
|
|
18
19
|
self._data = {}
|
|
19
20
|
|
|
21
|
+
def _extends_hint(self, instance_key: str) -> str:
|
|
22
|
+
entry = self._data.get(instance_key) or {}
|
|
23
|
+
base_key = entry.get(EXTENDS_KEY)
|
|
24
|
+
if not base_key:
|
|
25
|
+
return ""
|
|
26
|
+
return f" ('{instance_key}' {EXTENDS_KEY}: '{base_key}')"
|
|
27
|
+
|
|
28
|
+
def _resolve_entry(self, instance_key: str, visiting: Optional[Set[str]] = None) -> dict:
|
|
29
|
+
entry = self._data.get(instance_key)
|
|
30
|
+
if entry is None:
|
|
31
|
+
return None
|
|
32
|
+
|
|
33
|
+
base_key = entry.get(EXTENDS_KEY)
|
|
34
|
+
if not base_key:
|
|
35
|
+
return entry
|
|
36
|
+
|
|
37
|
+
if visiting is None:
|
|
38
|
+
visiting = set()
|
|
39
|
+
if instance_key in visiting:
|
|
40
|
+
raise TokenError(
|
|
41
|
+
f"Cycle in {CONFIG_FILE} config inheritance involving '{instance_key}'."
|
|
42
|
+
)
|
|
43
|
+
visiting.add(instance_key)
|
|
44
|
+
|
|
45
|
+
base_entry = self._resolve_entry(base_key, visiting)
|
|
46
|
+
if base_entry is None:
|
|
47
|
+
raise TokenError(
|
|
48
|
+
f"'{instance_key}:{EXTENDS_KEY}' in {CONFIG_FILE} points to a non-existent entry: '{base_key}'. "
|
|
49
|
+
f"Add '{base_key}' or define params directly on '{instance_key}'."
|
|
50
|
+
)
|
|
51
|
+
|
|
52
|
+
merged = dict(base_entry)
|
|
53
|
+
for key, value in entry.items():
|
|
54
|
+
if key != EXTENDS_KEY:
|
|
55
|
+
merged[key] = value
|
|
56
|
+
return merged
|
|
57
|
+
|
|
20
58
|
def lookup(self, usage: "Usage", param: str):
|
|
21
59
|
# this should be advertised as a well-known requirement: usage must define a 'instance' arg
|
|
22
60
|
instance = usage.get_arg("instance")
|
|
@@ -32,7 +70,7 @@ class Config:
|
|
|
32
70
|
if not type_default:
|
|
33
71
|
raise TokenError(f"{class_name} does not define '{param}' in config_tuples")
|
|
34
72
|
|
|
35
|
-
(param_type, param_default) = type_default
|
|
73
|
+
(param_type, param_default, optional) = type_default
|
|
36
74
|
|
|
37
75
|
instance_key = f'{class_name}-{instance}'
|
|
38
76
|
entry = self._data.get(instance_key, None)
|
|
@@ -41,15 +79,18 @@ class Config:
|
|
|
41
79
|
f"{CONFIG_FILE} does not contain entry for '{instance_key}' with required params."
|
|
42
80
|
)
|
|
43
81
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
82
|
+
resolved = self._resolve_entry(instance_key)
|
|
83
|
+
|
|
84
|
+
if param not in resolved and not optional and param_default is None:
|
|
85
|
+
hint = self._extends_hint(instance_key)
|
|
86
|
+
if hint:
|
|
87
|
+
base_key = entry.get(EXTENDS_KEY)
|
|
48
88
|
raise TokenError(
|
|
49
|
-
f"'{instance_key}
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
89
|
+
f"'{param}' missing from '{instance_key}' in {CONFIG_FILE}{hint}. "
|
|
90
|
+
f"Set it on '{base_key}' or override it on '{instance_key}'."
|
|
91
|
+
)
|
|
92
|
+
|
|
93
|
+
raw = resolved.get(param, param_default)
|
|
53
94
|
|
|
54
95
|
if not raw:
|
|
55
96
|
return None
|
|
@@ -171,7 +212,15 @@ class Usage:
|
|
|
171
212
|
self.config_tuples = tuples
|
|
172
213
|
|
|
173
214
|
def get_config_tuples(self) -> dict:
|
|
174
|
-
|
|
215
|
+
result = {}
|
|
216
|
+
for t in self.config_tuples:
|
|
217
|
+
if len(t) == 3:
|
|
218
|
+
name, param_type, default = t
|
|
219
|
+
optional = False
|
|
220
|
+
else:
|
|
221
|
+
name, param_type, default, optional = t
|
|
222
|
+
result[name] = (param_type, default, optional)
|
|
223
|
+
return result
|
|
175
224
|
|
|
176
225
|
# args and param values default as str
|
|
177
226
|
def def_arg(self, name: str, usage: str, is_num: bool = False, valid_values: Optional[Set[str]] = None):
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: python-jack-knife
|
|
3
|
-
Version: 0.7.
|
|
3
|
+
Version: 0.7.6
|
|
4
4
|
Summary: Python Jack Knife – a command line data processor
|
|
5
5
|
Author-email: Mike Schultz <mike.schultz@gmail.com>
|
|
6
6
|
License:
|
|
@@ -226,6 +226,9 @@ Provides-Extra: dev
|
|
|
226
226
|
Requires-Dist: pytest; extra == "dev"
|
|
227
227
|
Requires-Dist: black; extra == "dev"
|
|
228
228
|
Requires-Dist: ruff; extra == "dev"
|
|
229
|
+
Requires-Dist: build; extra == "dev"
|
|
230
|
+
Requires-Dist: twine; extra == "dev"
|
|
231
|
+
Requires-Dist: opensearch-py; extra == "dev"
|
|
229
232
|
Provides-Extra: all
|
|
230
233
|
Requires-Dist: boto3>=1.34; extra == "all"
|
|
231
234
|
Requires-Dist: pg8000>=1.30.0; extra == "all"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{python_jack_knife-0.7.5 → python_jack_knife-0.7.6}/src/pjk/integrations/opensearch_index_sink.py
RENAMED
|
File without changes
|
{python_jack_knife-0.7.5 → python_jack_knife-0.7.6}/src/pjk/integrations/opensearch_query_pipe.py
RENAMED
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{python_jack_knife-0.7.5 → python_jack_knife-0.7.6}/src/python_jack_knife.egg-info/SOURCES.txt
RENAMED
|
File without changes
|
|
File without changes
|
{python_jack_knife-0.7.5 → python_jack_knife-0.7.6}/src/python_jack_knife.egg-info/entry_points.txt
RENAMED
|
File without changes
|
{python_jack_knife-0.7.5 → python_jack_knife-0.7.6}/src/python_jack_knife.egg-info/top_level.txt
RENAMED
|
File without changes
|