etlplus 0.12.9__py3-none-any.whl → 0.12.11__py3-none-any.whl

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.
Files changed (59) hide show
  1. etlplus/file/accdb.py +78 -0
  2. etlplus/file/arrow.py +78 -0
  3. etlplus/file/avro.py +13 -1
  4. etlplus/file/bson.py +77 -0
  5. etlplus/file/cbor.py +78 -0
  6. etlplus/file/cfg.py +79 -0
  7. etlplus/file/conf.py +80 -0
  8. etlplus/file/csv.py +13 -1
  9. etlplus/file/dat.py +13 -1
  10. etlplus/file/dta.py +77 -0
  11. etlplus/file/duckdb.py +78 -0
  12. etlplus/file/enums.py +10 -4
  13. etlplus/file/feather.py +13 -1
  14. etlplus/file/fwf.py +12 -1
  15. etlplus/file/hbs.py +78 -0
  16. etlplus/file/hdf5.py +78 -0
  17. etlplus/file/ini.py +79 -0
  18. etlplus/file/ion.py +78 -0
  19. etlplus/file/jinja2.py +78 -0
  20. etlplus/file/json.py +13 -1
  21. etlplus/file/log.py +78 -0
  22. etlplus/file/mat.py +78 -0
  23. etlplus/file/mdb.py +78 -0
  24. etlplus/file/msgpack.py +78 -0
  25. etlplus/file/mustache.py +78 -0
  26. etlplus/file/nc.py +78 -0
  27. etlplus/file/ndjson.py +12 -6
  28. etlplus/file/numbers.py +75 -0
  29. etlplus/file/ods.py +79 -0
  30. etlplus/file/orc.py +13 -1
  31. etlplus/file/parquet.py +13 -1
  32. etlplus/file/pb.py +78 -0
  33. etlplus/file/pbf.py +77 -0
  34. etlplus/file/properties.py +78 -0
  35. etlplus/file/proto.py +77 -0
  36. etlplus/file/psv.py +14 -1
  37. etlplus/file/rda.py +78 -0
  38. etlplus/file/rds.py +78 -0
  39. etlplus/file/sas7bdat.py +78 -0
  40. etlplus/file/sav.py +77 -0
  41. etlplus/file/sqlite.py +78 -0
  42. etlplus/file/sylk.py +77 -0
  43. etlplus/file/tab.py +3 -4
  44. etlplus/file/toml.py +78 -0
  45. etlplus/file/tsv.py +14 -1
  46. etlplus/file/txt.py +11 -1
  47. etlplus/file/vm.py +78 -0
  48. etlplus/file/wks.py +77 -0
  49. etlplus/file/xlsm.py +79 -0
  50. etlplus/file/xml.py +12 -1
  51. etlplus/file/xpt.py +78 -0
  52. etlplus/file/yaml.py +12 -1
  53. etlplus/file/zsav.py +77 -0
  54. {etlplus-0.12.9.dist-info → etlplus-0.12.11.dist-info}/METADATA +31 -1
  55. {etlplus-0.12.9.dist-info → etlplus-0.12.11.dist-info}/RECORD +59 -22
  56. {etlplus-0.12.9.dist-info → etlplus-0.12.11.dist-info}/WHEEL +0 -0
  57. {etlplus-0.12.9.dist-info → etlplus-0.12.11.dist-info}/entry_points.txt +0 -0
  58. {etlplus-0.12.9.dist-info → etlplus-0.12.11.dist-info}/licenses/LICENSE +0 -0
  59. {etlplus-0.12.9.dist-info → etlplus-0.12.11.dist-info}/top_level.txt +0 -0
etlplus/file/mdb.py ADDED
@@ -0,0 +1,78 @@
1
+ """
2
+ :mod:`etlplus.file.mdb` module.
3
+
4
+ Helpers for reading/writing newer Microsoft Access database (MDB) files.
5
+
6
+ Notes
7
+ -----
8
+ - An MDB file is a proprietary database file format used by Microsoft Access
9
+ 2003 and earlier.
10
+ - Common cases:
11
+ - Storing relational data for small to medium-sized applications.
12
+ - Desktop database applications.
13
+ - Data management for non-enterprise solutions.
14
+ - Rule of thumb:
15
+ - If the file follows the MDB specification, use this module for reading
16
+ and writing.
17
+ """
18
+
19
+ from __future__ import annotations
20
+
21
+ from pathlib import Path
22
+
23
+ from ..types import JSONData
24
+ from ..types import JSONList
25
+ from . import stub
26
+
27
+ # SECTION: EXPORTS ========================================================== #
28
+
29
+
30
+ __all__ = [
31
+ 'read',
32
+ 'write',
33
+ ]
34
+
35
+
36
+ # SECTION: FUNCTIONS ======================================================== #
37
+
38
+
39
+ def read(
40
+ path: Path,
41
+ ) -> JSONList:
42
+ """
43
+ Read CSV content from ``path``.
44
+
45
+ Parameters
46
+ ----------
47
+ path : Path
48
+ Path to the CSV file on disk.
49
+
50
+ Returns
51
+ -------
52
+ JSONList
53
+ The list of dictionaries read from the CSV file.
54
+ """
55
+ return stub.read(path, format_name='DAT')
56
+
57
+
58
+ def write(
59
+ path: Path,
60
+ data: JSONData,
61
+ ) -> int:
62
+ """
63
+ Write ``data`` to CSV at ``path`` and return record count.
64
+
65
+ Parameters
66
+ ----------
67
+ path : Path
68
+ Path to the CSV file on disk.
69
+ data : JSONData
70
+ Data to write as CSV. Should be a list of dictionaries or a
71
+ single dictionary.
72
+
73
+ Returns
74
+ -------
75
+ int
76
+ The number of rows written to the CSV file.
77
+ """
78
+ return stub.write(path, data, format_name='DAT')
@@ -0,0 +1,78 @@
1
+ """
2
+ :mod:`etlplus.file.msgpack` module.
3
+
4
+ Helpers for reading/writing MessagePack (MSGPACK) files.
5
+
6
+ Notes
7
+ -----
8
+ - A MsgPack file is a binary serialization format that is more compact than
9
+ JSON.
10
+ - Common cases:
11
+ - Efficient data storage and transmission.
12
+ - Inter-process communication.
13
+ - Data serialization in performance-critical applications.
14
+ - Rule of thumb:
15
+ - If the file follows the MsgPack specification, use this module for
16
+ reading and writing.
17
+ """
18
+
19
+ from __future__ import annotations
20
+
21
+ from pathlib import Path
22
+
23
+ from ..types import JSONData
24
+ from ..types import JSONList
25
+ from . import stub
26
+
27
+ # SECTION: EXPORTS ========================================================== #
28
+
29
+
30
+ __all__ = [
31
+ 'read',
32
+ 'write',
33
+ ]
34
+
35
+
36
+ # SECTION: FUNCTIONS ======================================================== #
37
+
38
+
39
+ def read(
40
+ path: Path,
41
+ ) -> JSONList:
42
+ """
43
+ Read MsgPack content from ``path``.
44
+
45
+ Parameters
46
+ ----------
47
+ path : Path
48
+ Path to the MsgPack file on disk.
49
+
50
+ Returns
51
+ -------
52
+ JSONList
53
+ The list of dictionaries read from the MsgPack file.
54
+ """
55
+ return stub.read(path, format_name='MSGPACK')
56
+
57
+
58
+ def write(
59
+ path: Path,
60
+ data: JSONData,
61
+ ) -> int:
62
+ """
63
+ Write ``data`` to MsgPack at ``path`` and return record count.
64
+
65
+ Parameters
66
+ ----------
67
+ path : Path
68
+ Path to the MsgPack file on disk.
69
+ data : JSONData
70
+ Data to write as MsgPack. Should be a list of dictionaries or a
71
+ single dictionary.
72
+
73
+ Returns
74
+ -------
75
+ int
76
+ The number of rows written to the MsgPack file.
77
+ """
78
+ return stub.write(path, data, format_name='MSGPACK')
@@ -0,0 +1,78 @@
1
+ """
2
+ :mod:`etlplus.file.mustache` module.
3
+
4
+ Helpers for reading/writing Mustache (MUSTACHE) template files.
5
+
6
+ Notes
7
+ -----
8
+ - A MUSTACHE file is a text file used for generating HTML or other text formats
9
+ by combining templates with data.
10
+ - Common cases:
11
+ - HTML templates.
12
+ - Email templates.
13
+ - Configuration files.
14
+ - Rule of thumb:
15
+ - If you need to work with Mustache template files, use this module for
16
+ reading and writing.
17
+ """
18
+
19
+ from __future__ import annotations
20
+
21
+ from pathlib import Path
22
+
23
+ from ..types import JSONData
24
+ from ..types import JSONList
25
+ from . import stub
26
+
27
+ # SECTION: EXPORTS ========================================================== #
28
+
29
+
30
+ __all__ = [
31
+ 'read',
32
+ 'write',
33
+ ]
34
+
35
+
36
+ # SECTION: FUNCTIONS ======================================================== #
37
+
38
+
39
+ def read(
40
+ path: Path,
41
+ ) -> JSONList:
42
+ """
43
+ Read MUSTACHE content from ``path``.
44
+
45
+ Parameters
46
+ ----------
47
+ path : Path
48
+ Path to the MUSTACHE file on disk.
49
+
50
+ Returns
51
+ -------
52
+ JSONList
53
+ The list of dictionaries read from the MUSTACHE file.
54
+ """
55
+ return stub.read(path, format_name='MUSTACHE')
56
+
57
+
58
+ def write(
59
+ path: Path,
60
+ data: JSONData,
61
+ ) -> int:
62
+ """
63
+ Write ``data`` to MUSTACHE file at ``path`` and return record count.
64
+
65
+ Parameters
66
+ ----------
67
+ path : Path
68
+ Path to the MUSTACHE file on disk.
69
+ data : JSONData
70
+ Data to write as MUSTACHE file. Should be a list of dictionaries or a
71
+ single dictionary.
72
+
73
+ Returns
74
+ -------
75
+ int
76
+ The number of rows written to the MUSTACHE file.
77
+ """
78
+ return stub.write(path, data, format_name='MUSTACHE')
etlplus/file/nc.py ADDED
@@ -0,0 +1,78 @@
1
+ """
2
+ :mod:`etlplus.file.nc` module.
3
+
4
+ Helpers for reading/writing NetCDF (NC) data files.
5
+
6
+ Notes
7
+ -----
8
+ - A NC file is a binary file format used for array-oriented scientific data,
9
+ particularly in meteorology, oceanography, and climate science.
10
+ - Common cases:
11
+ - Storing multi-dimensional scientific data.
12
+ - Sharing large datasets in research communities.
13
+ - Efficient data access and manipulation.
14
+ - Rule of thumb:
15
+ - If the file follows the NetCDF standard, use this module for
16
+ reading and writing.
17
+ """
18
+
19
+ from __future__ import annotations
20
+
21
+ from pathlib import Path
22
+
23
+ from ..types import JSONData
24
+ from ..types import JSONList
25
+ from . import stub
26
+
27
+ # SECTION: EXPORTS ========================================================== #
28
+
29
+
30
+ __all__ = [
31
+ 'read',
32
+ 'write',
33
+ ]
34
+
35
+
36
+ # SECTION: FUNCTIONS ======================================================== #
37
+
38
+
39
+ def read(
40
+ path: Path,
41
+ ) -> JSONList:
42
+ """
43
+ Read NC content from ``path``.
44
+
45
+ Parameters
46
+ ----------
47
+ path : Path
48
+ Path to the NC file on disk.
49
+
50
+ Returns
51
+ -------
52
+ JSONList
53
+ The list of dictionaries read from the NC file.
54
+ """
55
+ return stub.read(path, format_name='NC')
56
+
57
+
58
+ def write(
59
+ path: Path,
60
+ data: JSONData,
61
+ ) -> int:
62
+ """
63
+ Write ``data`` to NC file at ``path`` and return record count.
64
+
65
+ Parameters
66
+ ----------
67
+ path : Path
68
+ Path to the NC file on disk.
69
+ data : JSONData
70
+ Data to write as NC file. Should be a list of dictionaries or a
71
+ single dictionary.
72
+
73
+ Returns
74
+ -------
75
+ int
76
+ The number of rows written to the NC file.
77
+ """
78
+ return stub.write(path, data, format_name='NC')
etlplus/file/ndjson.py CHANGED
@@ -1,7 +1,18 @@
1
1
  """
2
2
  :mod:`etlplus.file.ndjson` module.
3
3
 
4
- Helpers for reading/writing NDJSON files.
4
+ Helpers for reading/writing Newline Delimited JSON (NDJSON) files.
5
+
6
+ Notes
7
+ -----
8
+ - An NDJSON file is a format where each line is a separate JSON object.
9
+ - Common cases:
10
+ - Streaming JSON data.
11
+ - Log files with JSON entries.
12
+ - Large datasets that are processed line-by-line.
13
+ - Rule of thumb:
14
+ - If the file follows the NDJSON specification, use this module for
15
+ reading and writing.
5
16
  """
6
17
 
7
18
  from __future__ import annotations
@@ -82,11 +93,6 @@ def write(
82
93
  -------
83
94
  int
84
95
  Number of records written.
85
-
86
- Raises
87
- ------
88
- TypeError
89
- If ``data`` is a list containing non-dict items.
90
96
  """
91
97
  rows = normalize_records(data, 'NDJSON')
92
98
 
@@ -0,0 +1,75 @@
1
+ """
2
+ :mod:`etlplus.file.numbers` module.
3
+
4
+ Helpers for reading/writing Apple Numbers (NUMBERS) spreadsheet files.
5
+
6
+ Notes
7
+ -----
8
+ - A NUMBERS file is a spreadsheet file created by Apple Numbers.
9
+ - Common cases:
10
+ - Spreadsheet files created by Apple Numbers.
11
+ - Rule of thumb:
12
+ - If you need to read/write NUMBERS files, consider converting them to
13
+ more common formats like CSV or XLSX for better compatibility.
14
+ """
15
+
16
+ from __future__ import annotations
17
+
18
+ from pathlib import Path
19
+
20
+ from ..types import JSONData
21
+ from ..types import JSONList
22
+ from . import stub
23
+
24
+ # SECTION: EXPORTS ========================================================== #
25
+
26
+
27
+ __all__ = [
28
+ 'read',
29
+ 'write',
30
+ ]
31
+
32
+
33
+ # SECTION: FUNCTIONS ======================================================== #
34
+
35
+
36
+ def read(
37
+ path: Path,
38
+ ) -> JSONList:
39
+ """
40
+ Read NUMBERS content from ``path``.
41
+
42
+ Parameters
43
+ ----------
44
+ path : Path
45
+ Path to the NUMBERS file on disk.
46
+
47
+ Returns
48
+ -------
49
+ JSONList
50
+ The list of dictionaries read from the NUMBERS file.
51
+ """
52
+ return stub.read(path, format_name='NUMBERS')
53
+
54
+
55
+ def write(
56
+ path: Path,
57
+ data: JSONData,
58
+ ) -> int:
59
+ """
60
+ Write ``data`` to NUMBERS file at ``path`` and return record count.
61
+
62
+ Parameters
63
+ ----------
64
+ path : Path
65
+ Path to the NUMBERS file on disk.
66
+ data : JSONData
67
+ Data to write as NUMBERS file. Should be a list of dictionaries or a
68
+ single dictionary.
69
+
70
+ Returns
71
+ -------
72
+ int
73
+ The number of rows written to the NUMBERS file.
74
+ """
75
+ return stub.write(path, data, format_name='NUMBERS')
etlplus/file/ods.py ADDED
@@ -0,0 +1,79 @@
1
+ """
2
+ :mod:`etlplus.file.ods` module.
3
+
4
+ Helpers for reading/writing OpenDocument (ODS) spreadsheet files.
5
+
6
+ Notes
7
+ -----
8
+ - An ODS file is a spreadsheet file created using the OpenDocument format.
9
+ - Common cases:
10
+ - Spreadsheet files created by LibreOffice Calc, Apache OpenOffice Calc, or
11
+ other applications that support the OpenDocument format.
12
+ - Spreadsheet files exchanged in open standards environments.
13
+ - Spreadsheet files used in government or educational institutions
14
+ promoting open formats.
15
+ - Rule of thumb:
16
+ - If the file follows the OpenDocument specification, use this module for
17
+ reading and writing.
18
+ """
19
+
20
+ from __future__ import annotations
21
+
22
+ from pathlib import Path
23
+
24
+ from ..types import JSONData
25
+ from ..types import JSONList
26
+ from . import stub
27
+
28
+ # SECTION: EXPORTS ========================================================== #
29
+
30
+
31
+ __all__ = [
32
+ 'read',
33
+ 'write',
34
+ ]
35
+
36
+
37
+ # SECTION: FUNCTIONS ======================================================== #
38
+
39
+
40
+ def read(
41
+ path: Path,
42
+ ) -> JSONList:
43
+ """
44
+ Read ODS content from ``path``.
45
+
46
+ Parameters
47
+ ----------
48
+ path : Path
49
+ Path to the ODS file on disk.
50
+
51
+ Returns
52
+ -------
53
+ JSONList
54
+ The list of dictionaries read from the ODS file.
55
+ """
56
+ return stub.read(path, format_name='ODS')
57
+
58
+
59
+ def write(
60
+ path: Path,
61
+ data: JSONData,
62
+ ) -> int:
63
+ """
64
+ Write ``data`` to ODS file at ``path`` and return record count.
65
+
66
+ Parameters
67
+ ----------
68
+ path : Path
69
+ Path to the ODS file on disk.
70
+ data : JSONData
71
+ Data to write as ODS file. Should be a list of dictionaries or a
72
+ single dictionary.
73
+
74
+ Returns
75
+ -------
76
+ int
77
+ The number of rows written to the ODS file.
78
+ """
79
+ return stub.write(path, data, format_name='ODS')
etlplus/file/orc.py CHANGED
@@ -1,7 +1,19 @@
1
1
  """
2
2
  :mod:`etlplus.file.orc` module.
3
3
 
4
- Helpers for reading/writing ORC files.
4
+ Helpers for reading/writing Optimized Row Columnar (ORC) files.
5
+
6
+ Notes
7
+ -----
8
+ - An ORC file is a columnar storage file format optimized for Big Data
9
+ processing.
10
+ - Common cases:
11
+ - Efficient storage and retrieval of large datasets.
12
+ - Integration with big data frameworks like Apache Hive and Apache Spark.
13
+ - Compression and performance optimization for analytical queries.
14
+ - Rule of thumb:
15
+ - If the file follows the ORC specification, use this module for reading
16
+ and writing.
5
17
  """
6
18
 
7
19
  from __future__ import annotations
etlplus/file/parquet.py CHANGED
@@ -1,7 +1,19 @@
1
1
  """
2
2
  :mod:`etlplus.file.parquet` module.
3
3
 
4
- Helpers for reading/writing Parquet files.
4
+ Helpers for reading/writing Apache Parquet (PARQUET) files.
5
+
6
+ Notes
7
+ -----
8
+ - An Apache Parquet file is a columnar storage file format optimized for Big
9
+ Data processing.
10
+ - Common cases:
11
+ - Efficient storage and retrieval of large datasets.
12
+ - Integration with big data frameworks like Apache Hive and Apache Spark.
13
+ - Compression and performance optimization for analytical queries.
14
+ - Rule of thumb:
15
+ - If the file follows the Apache Parquet specification, use this module for
16
+ reading and writing.
5
17
  """
6
18
 
7
19
  from __future__ import annotations
etlplus/file/pb.py ADDED
@@ -0,0 +1,78 @@
1
+ """
2
+ :mod:`etlplus.file.pb` module.
3
+
4
+ Helpers for reading/writing Protocol Buffer (PB) files.
5
+
6
+ Notes
7
+ -----
8
+ - PB (a.k.a. Protobuff) is a binary serialization format developed by Google
9
+ for structured data.
10
+ - Common cases:
11
+ - Data interchange between services.
12
+ - Efficient storage of structured data.
13
+ - Communication in distributed systems.
14
+ - Rule of thumb:
15
+ - If the file follows the Protocol Buffer specification, use this module
16
+ for reading and writing.
17
+ """
18
+
19
+ from __future__ import annotations
20
+
21
+ from pathlib import Path
22
+
23
+ from ..types import JSONData
24
+ from ..types import JSONList
25
+ from . import stub
26
+
27
+ # SECTION: EXPORTS ========================================================== #
28
+
29
+
30
+ __all__ = [
31
+ 'read',
32
+ 'write',
33
+ ]
34
+
35
+
36
+ # SECTION: FUNCTIONS ======================================================== #
37
+
38
+
39
+ def read(
40
+ path: Path,
41
+ ) -> JSONList:
42
+ """
43
+ Read PB content from ``path``.
44
+
45
+ Parameters
46
+ ----------
47
+ path : Path
48
+ Path to the PB file on disk.
49
+
50
+ Returns
51
+ -------
52
+ JSONList
53
+ The list of dictionaries read from the PB file.
54
+ """
55
+ return stub.read(path, format_name='PB')
56
+
57
+
58
+ def write(
59
+ path: Path,
60
+ data: JSONData,
61
+ ) -> int:
62
+ """
63
+ Write ``data`` to PB at ``path`` and return record count.
64
+
65
+ Parameters
66
+ ----------
67
+ path : Path
68
+ Path to the PB file on disk.
69
+ data : JSONData
70
+ Data to write as PB. Should be a list of dictionaries or a
71
+ single dictionary.
72
+
73
+ Returns
74
+ -------
75
+ int
76
+ The number of rows written to the PB file.
77
+ """
78
+ return stub.write(path, data, format_name='PB')
etlplus/file/pbf.py ADDED
@@ -0,0 +1,77 @@
1
+ """
2
+ :mod:`etlplus.file.pbf` module.
3
+
4
+ Helpers for reading/writing Protocolbuffer Binary Format (PBF) files.
5
+
6
+ Notes
7
+ -----
8
+ - PBF is a binary format used primarily for OpenStreetMap (OSM) data.
9
+ - Common cases:
10
+ - Efficient storage of large OSM datasets.
11
+ - Fast data interchange for mapping applications.
12
+ - Compression of OSM data for reduced file size.
13
+ - Rule of thumb:
14
+ - If the file follows the PBF specification, use this module for reading
15
+ and writing.
16
+ """
17
+
18
+ from __future__ import annotations
19
+
20
+ from pathlib import Path
21
+
22
+ from ..types import JSONData
23
+ from ..types import JSONList
24
+ from . import stub
25
+
26
+ # SECTION: EXPORTS ========================================================== #
27
+
28
+
29
+ __all__ = [
30
+ 'read',
31
+ 'write',
32
+ ]
33
+
34
+
35
+ # SECTION: FUNCTIONS ======================================================== #
36
+
37
+
38
+ def read(
39
+ path: Path,
40
+ ) -> JSONList:
41
+ """
42
+ Read PBF content from ``path``.
43
+
44
+ Parameters
45
+ ----------
46
+ path : Path
47
+ Path to the PBF file on disk.
48
+
49
+ Returns
50
+ -------
51
+ JSONList
52
+ The list of dictionaries read from the PBF file.
53
+ """
54
+ return stub.read(path, format_name='PBF')
55
+
56
+
57
+ def write(
58
+ path: Path,
59
+ data: JSONData,
60
+ ) -> int:
61
+ """
62
+ Write ``data`` to PBF at ``path`` and return record count.
63
+
64
+ Parameters
65
+ ----------
66
+ path : Path
67
+ Path to the PBF file on disk.
68
+ data : JSONData
69
+ Data to write as PBF. Should be a list of dictionaries or a
70
+ single dictionary.
71
+
72
+ Returns
73
+ -------
74
+ int
75
+ The number of rows written to the PBF file.
76
+ """
77
+ return stub.write(path, data, format_name='PBF')