dbtk 0.8.1__tar.gz → 0.8.2__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.
- {dbtk-0.8.1 → dbtk-0.8.2}/PKG-INFO +1 -1
- {dbtk-0.8.1 → dbtk-0.8.2}/dbtk/__init__.py +1 -1
- {dbtk-0.8.1 → dbtk-0.8.2}/dbtk/cli.py +2 -1
- {dbtk-0.8.1 → dbtk-0.8.2}/dbtk/etl/table.py +1 -1
- {dbtk-0.8.1 → dbtk-0.8.2}/dbtk/readers/fixed_width.py +2 -2
- {dbtk-0.8.1 → dbtk-0.8.2}/dbtk/writers/base.py +2 -2
- {dbtk-0.8.1 → dbtk-0.8.2}/dbtk/writers/xml.py +1 -1
- {dbtk-0.8.1 → dbtk-0.8.2}/dbtk.egg-info/PKG-INFO +1 -1
- {dbtk-0.8.1 → dbtk-0.8.2}/pyproject.toml +5 -1
- {dbtk-0.8.1 → dbtk-0.8.2}/LICENSE.txt +0 -0
- {dbtk-0.8.1 → dbtk-0.8.2}/README.md +0 -0
- {dbtk-0.8.1 → dbtk-0.8.2}/dbtk/config.py +0 -0
- {dbtk-0.8.1 → dbtk-0.8.2}/dbtk/cursors.py +0 -0
- {dbtk-0.8.1 → dbtk-0.8.2}/dbtk/database.py +0 -0
- {dbtk-0.8.1 → dbtk-0.8.2}/dbtk/dbtk_sample.yml +0 -0
- {dbtk-0.8.1 → dbtk-0.8.2}/dbtk/defaults.py +0 -0
- {dbtk-0.8.1 → dbtk-0.8.2}/dbtk/etl/__init__.py +0 -0
- {dbtk-0.8.1 → dbtk-0.8.2}/dbtk/etl/base_surge.py +0 -0
- {dbtk-0.8.1 → dbtk-0.8.2}/dbtk/etl/bulk_surge.py +0 -0
- {dbtk-0.8.1 → dbtk-0.8.2}/dbtk/etl/config_generators.py +0 -0
- {dbtk-0.8.1 → dbtk-0.8.2}/dbtk/etl/data_surge.py +0 -0
- {dbtk-0.8.1 → dbtk-0.8.2}/dbtk/etl/managers.py +0 -0
- {dbtk-0.8.1 → dbtk-0.8.2}/dbtk/etl/transforms/__init__.py +0 -0
- {dbtk-0.8.1 → dbtk-0.8.2}/dbtk/etl/transforms/address.py +0 -0
- {dbtk-0.8.1 → dbtk-0.8.2}/dbtk/etl/transforms/core.py +0 -0
- {dbtk-0.8.1 → dbtk-0.8.2}/dbtk/etl/transforms/database.py +0 -0
- {dbtk-0.8.1 → dbtk-0.8.2}/dbtk/etl/transforms/datetime.py +0 -0
- {dbtk-0.8.1 → dbtk-0.8.2}/dbtk/etl/transforms/email.py +0 -0
- {dbtk-0.8.1 → dbtk-0.8.2}/dbtk/etl/transforms/phone.py +0 -0
- {dbtk-0.8.1 → dbtk-0.8.2}/dbtk/formats/__init__.py +0 -0
- {dbtk-0.8.1 → dbtk-0.8.2}/dbtk/formats/edi.py +0 -0
- {dbtk-0.8.1 → dbtk-0.8.2}/dbtk/logging_utils.py +0 -0
- {dbtk-0.8.1 → dbtk-0.8.2}/dbtk/readers/__init__.py +0 -0
- {dbtk-0.8.1 → dbtk-0.8.2}/dbtk/readers/base.py +0 -0
- {dbtk-0.8.1 → dbtk-0.8.2}/dbtk/readers/csv.py +0 -0
- {dbtk-0.8.1 → dbtk-0.8.2}/dbtk/readers/data_frame.py +0 -0
- {dbtk-0.8.1 → dbtk-0.8.2}/dbtk/readers/excel.py +0 -0
- {dbtk-0.8.1 → dbtk-0.8.2}/dbtk/readers/json.py +0 -0
- {dbtk-0.8.1 → dbtk-0.8.2}/dbtk/readers/utils.py +0 -0
- {dbtk-0.8.1 → dbtk-0.8.2}/dbtk/readers/xml.py +0 -0
- {dbtk-0.8.1 → dbtk-0.8.2}/dbtk/record.py +0 -0
- {dbtk-0.8.1 → dbtk-0.8.2}/dbtk/utils.py +0 -0
- {dbtk-0.8.1 → dbtk-0.8.2}/dbtk/writers/__init__.py +0 -0
- {dbtk-0.8.1 → dbtk-0.8.2}/dbtk/writers/csv.py +0 -0
- {dbtk-0.8.1 → dbtk-0.8.2}/dbtk/writers/database.py +0 -0
- {dbtk-0.8.1 → dbtk-0.8.2}/dbtk/writers/excel.py +0 -0
- {dbtk-0.8.1 → dbtk-0.8.2}/dbtk/writers/fixed_width.py +0 -0
- {dbtk-0.8.1 → dbtk-0.8.2}/dbtk/writers/json.py +0 -0
- {dbtk-0.8.1 → dbtk-0.8.2}/dbtk/writers/utils.py +0 -0
- {dbtk-0.8.1 → dbtk-0.8.2}/dbtk.egg-info/SOURCES.txt +0 -0
- {dbtk-0.8.1 → dbtk-0.8.2}/dbtk.egg-info/dependency_links.txt +0 -0
- {dbtk-0.8.1 → dbtk-0.8.2}/dbtk.egg-info/entry_points.txt +0 -0
- {dbtk-0.8.1 → dbtk-0.8.2}/dbtk.egg-info/requires.txt +0 -0
- {dbtk-0.8.1 → dbtk-0.8.2}/dbtk.egg-info/top_level.txt +0 -0
- {dbtk-0.8.1 → dbtk-0.8.2}/setup.cfg +0 -0
- {dbtk-0.8.1 → dbtk-0.8.2}/tests/test_bulk.py +0 -0
- {dbtk-0.8.1 → dbtk-0.8.2}/tests/test_config.py +0 -0
- {dbtk-0.8.1 → dbtk-0.8.2}/tests/test_data_bending.py +0 -0
- {dbtk-0.8.1 → dbtk-0.8.2}/tests/test_edi_writer.py +0 -0
- {dbtk-0.8.1 → dbtk-0.8.2}/tests/test_excel_writer.py +0 -0
- {dbtk-0.8.1 → dbtk-0.8.2}/tests/test_fixed_width_record.py +0 -0
- {dbtk-0.8.1 → dbtk-0.8.2}/tests/test_logging_utils.py +0 -0
- {dbtk-0.8.1 → dbtk-0.8.2}/tests/test_readers.py +0 -0
- {dbtk-0.8.1 → dbtk-0.8.2}/tests/test_table.py +0 -0
- {dbtk-0.8.1 → dbtk-0.8.2}/tests/test_table_new_features.py +0 -0
- {dbtk-0.8.1 → dbtk-0.8.2}/tests/test_transforms_core.py +0 -0
- {dbtk-0.8.1 → dbtk-0.8.2}/tests/test_transforms_datetime.py +0 -0
- {dbtk-0.8.1 → dbtk-0.8.2}/tests/test_transforms_phone.py +0 -0
- {dbtk-0.8.1 → dbtk-0.8.2}/tests/test_validation_collector.py +0 -0
- {dbtk-0.8.1 → dbtk-0.8.2}/tests/test_writers.py +0 -0
|
@@ -36,9 +36,9 @@ from .database import Database
|
|
|
36
36
|
from .config import connect, set_config_file
|
|
37
37
|
from .cursors import Cursor
|
|
38
38
|
from .logging_utils import setup_logging, cleanup_old_logs, errors_logged
|
|
39
|
-
from . import etl
|
|
40
39
|
from . import readers
|
|
41
40
|
from . import writers
|
|
41
|
+
from . import etl
|
|
42
42
|
|
|
43
43
|
# Simple, clean exports
|
|
44
44
|
__all__ = [
|
|
@@ -114,7 +114,8 @@ def checkup():
|
|
|
114
114
|
|
|
115
115
|
def main():
|
|
116
116
|
parser = argparse.ArgumentParser(prog='dbtk', description='DBTK command-line utilities')
|
|
117
|
-
subparsers = parser.add_subparsers(dest='command'
|
|
117
|
+
subparsers = parser.add_subparsers(dest='command')
|
|
118
|
+
subparsers.required = True # required= kwarg not supported in Python 3.6
|
|
118
119
|
|
|
119
120
|
# checkup
|
|
120
121
|
subparsers.add_parser('checkup', help='Check for dependencies and configuration issues')
|
|
@@ -63,7 +63,7 @@ class Table:
|
|
|
63
63
|
'user_id': {'default': lambda: conf_vars['user_id']},
|
|
64
64
|
}
|
|
65
65
|
|
|
66
|
-
* **fn** (callable
|
|
66
|
+
* **fn** (Union[callable, List[callable], str], optional):
|
|
67
67
|
Transformation function(s) to apply to the source value.
|
|
68
68
|
callable: applied directly; list: functions applied in order (pipeline);
|
|
69
69
|
str: magic shorthand (e.g. 'int', 'maxlen:255', 'lookup:table:col:val').
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
import logging
|
|
6
6
|
import os
|
|
7
|
-
from typing import TextIO, List, Dict, Any, Optional, Iterator
|
|
7
|
+
from typing import TextIO, List, Dict, Any, Optional, Iterator, Type
|
|
8
8
|
|
|
9
9
|
from .base import Reader
|
|
10
10
|
from ..record import Record, FixedWidthRecord
|
|
@@ -271,7 +271,7 @@ class EDIReader(FixedReader):
|
|
|
271
271
|
def _get_columns(self, type_code: str) -> List[FixedColumn]:
|
|
272
272
|
return self.columns.get(type_code)
|
|
273
273
|
|
|
274
|
-
def _get_factory(self, type_code: str) ->
|
|
274
|
+
def _get_factory(self, type_code: str) -> Type[Record]:
|
|
275
275
|
if type_code not in self._type_factories:
|
|
276
276
|
cols = self._get_columns(type_code)
|
|
277
277
|
if cols is None:
|
|
@@ -181,7 +181,7 @@ class BaseWriter(ABC):
|
|
|
181
181
|
|
|
182
182
|
Returns
|
|
183
183
|
-------
|
|
184
|
-
|
|
184
|
+
Tuple[Union[TextIO, BinaryIO], bool]
|
|
185
185
|
(file_handle, should_close_flag)
|
|
186
186
|
"""
|
|
187
187
|
if self.file is None:
|
|
@@ -280,7 +280,7 @@ class BaseWriter(ABC):
|
|
|
280
280
|
|
|
281
281
|
Returns
|
|
282
282
|
-------
|
|
283
|
-
|
|
283
|
+
Tuple[Optional[Iterator], Optional[List[str]]]
|
|
284
284
|
(iterator, column_names)
|
|
285
285
|
"""
|
|
286
286
|
if not data:
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "dbtk"
|
|
7
|
-
version = "0.8.
|
|
7
|
+
version = "0.8.2"
|
|
8
8
|
description = "Data Benders Toolkit - A lightweight toolkit for data integration, ELT and ETL"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
requires-python = ">=3.6"
|
|
@@ -78,5 +78,9 @@ Homepage = "https://github.com/scottrbailey/dbtk"
|
|
|
78
78
|
Documentation = "https://dbtk.readthedocs.io"
|
|
79
79
|
Repository = "https://github.com/scottrbailey/dbtk.git"
|
|
80
80
|
|
|
81
|
+
[tool.setuptools.packages.find]
|
|
82
|
+
where = ["."]
|
|
83
|
+
include = ["dbtk*"]
|
|
84
|
+
|
|
81
85
|
[tool.setuptools.package-data]
|
|
82
86
|
dbtk = ["dbtk_sample.yml"]
|
|
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
|