mindoff-dataport 0.1.0__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.
- mindoff_dataport/__init__.py +86 -0
- mindoff_dataport/bundle.py +921 -0
- mindoff_dataport/extractor.py +257 -0
- mindoff_dataport/pdf_renderer.py +1201 -0
- mindoff_dataport/schema.py +95 -0
- mindoff_dataport/style_conversion.py +144 -0
- mindoff_dataport/template_contract.py +441 -0
- mindoff_dataport/xlsx_builder.py +175 -0
- mindoff_dataport/xlsx_renderer.py +1153 -0
- mindoff_dataport-0.1.0.dist-info/METADATA +879 -0
- mindoff_dataport-0.1.0.dist-info/RECORD +12 -0
- mindoff_dataport-0.1.0.dist-info/WHEEL +4 -0
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from types import SimpleNamespace
|
|
4
|
+
from typing import Any, Literal
|
|
5
|
+
|
|
6
|
+
from .bundle import (
|
|
7
|
+
ReportBundle,
|
|
8
|
+
compile_report_bundle as _compile_report_bundle_impl,
|
|
9
|
+
)
|
|
10
|
+
from .extractor import extract_template as _extract_template_impl
|
|
11
|
+
from .schema import WorkbookSchema
|
|
12
|
+
from .template_contract import get_template_inputs as _get_template_inputs_impl
|
|
13
|
+
from .xlsx_renderer import export_report_bundle as _export_report_bundle_impl
|
|
14
|
+
|
|
15
|
+
__all__ = [
|
|
16
|
+
"ReportBundle",
|
|
17
|
+
"extract_template",
|
|
18
|
+
"get_template_inputs",
|
|
19
|
+
"compile_report_bundle",
|
|
20
|
+
"export_report_bundle",
|
|
21
|
+
"extract",
|
|
22
|
+
"inputs",
|
|
23
|
+
"compile",
|
|
24
|
+
"export",
|
|
25
|
+
"mo_dataport",
|
|
26
|
+
]
|
|
27
|
+
|
|
28
|
+
# §1. Constants & Exceptions
|
|
29
|
+
|
|
30
|
+
# §2. Classes and Sub Classes
|
|
31
|
+
|
|
32
|
+
# §3. Private Helper Functions
|
|
33
|
+
|
|
34
|
+
# §4. Public Functions
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
def extract_template(path: str) -> WorkbookSchema:
|
|
38
|
+
return _extract_template_impl(path)
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
def get_template_inputs(template: WorkbookSchema) -> dict[str, Any]:
|
|
42
|
+
return _get_template_inputs_impl(template)
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
def compile_report_bundle(
|
|
46
|
+
template: WorkbookSchema,
|
|
47
|
+
data: dict[str, Any],
|
|
48
|
+
bundle_path: str | None = None,
|
|
49
|
+
dataframe_options: dict[str, Any] | None = None,
|
|
50
|
+
) -> ReportBundle:
|
|
51
|
+
return _compile_report_bundle_impl(
|
|
52
|
+
template,
|
|
53
|
+
data,
|
|
54
|
+
bundle_path=bundle_path,
|
|
55
|
+
dataframe_options=dataframe_options,
|
|
56
|
+
)
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
def export_report_bundle(
|
|
60
|
+
bundle_or_path: ReportBundle | str,
|
|
61
|
+
output_path: str,
|
|
62
|
+
format: Literal["xlsx", "pdf", "image"] = "xlsx",
|
|
63
|
+
**options: Any,
|
|
64
|
+
) -> None | list[str]:
|
|
65
|
+
return _export_report_bundle_impl(
|
|
66
|
+
bundle_or_path,
|
|
67
|
+
output_path,
|
|
68
|
+
format=format,
|
|
69
|
+
**options,
|
|
70
|
+
)
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
extract = extract_template
|
|
74
|
+
inputs = get_template_inputs
|
|
75
|
+
compile = compile_report_bundle
|
|
76
|
+
export = export_report_bundle
|
|
77
|
+
|
|
78
|
+
mo_dataport = SimpleNamespace(
|
|
79
|
+
extract=extract_template,
|
|
80
|
+
inputs=get_template_inputs,
|
|
81
|
+
compile=compile_report_bundle,
|
|
82
|
+
export=export_report_bundle,
|
|
83
|
+
)
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
# §5. Entrypoints
|