tesorotools-python 0.0.10__tar.gz → 0.0.12__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.
- {tesorotools_python-0.0.10 → tesorotools_python-0.0.12}/PKG-INFO +1 -1
- {tesorotools_python-0.0.10 → tesorotools_python-0.0.12}/pyproject.toml +1 -1
- {tesorotools_python-0.0.10 → tesorotools_python-0.0.12}/tesorotools/render/__init__.py +2 -0
- {tesorotools_python-0.0.10 → tesorotools_python-0.0.12}/tesorotools/render/content/table.py +15 -6
- tesorotools_python-0.0.12/tesorotools/render/content/text.py +23 -0
- {tesorotools_python-0.0.10 → tesorotools_python-0.0.12}/.gitignore +0 -0
- {tesorotools_python-0.0.10 → tesorotools_python-0.0.12}/tesorotools/__init__.py +0 -0
- {tesorotools_python-0.0.10 → tesorotools_python-0.0.12}/tesorotools/artists/__init__.py +0 -0
- {tesorotools_python-0.0.10 → tesorotools_python-0.0.12}/tesorotools/artists/barh_plot.py +0 -0
- {tesorotools_python-0.0.10 → tesorotools_python-0.0.12}/tesorotools/artists/line_plot.py +0 -0
- {tesorotools_python-0.0.10 → tesorotools_python-0.0.12}/tesorotools/artists/table.py +0 -0
- {tesorotools_python-0.0.10 → tesorotools_python-0.0.12}/tesorotools/artists/type_curve.py +0 -0
- {tesorotools_python-0.0.10 → tesorotools_python-0.0.12}/tesorotools/assets/README.md +0 -0
- {tesorotools_python-0.0.10 → tesorotools_python-0.0.12}/tesorotools/assets/fonts/CabinetGrotesk-Black.otf +0 -0
- {tesorotools_python-0.0.10 → tesorotools_python-0.0.12}/tesorotools/assets/fonts/CabinetGrotesk-Bold.otf +0 -0
- {tesorotools_python-0.0.10 → tesorotools_python-0.0.12}/tesorotools/assets/fonts/CabinetGrotesk-Extrabold.otf +0 -0
- {tesorotools_python-0.0.10 → tesorotools_python-0.0.12}/tesorotools/assets/fonts/CabinetGrotesk-Extralight.otf +0 -0
- {tesorotools_python-0.0.10 → tesorotools_python-0.0.12}/tesorotools/assets/fonts/CabinetGrotesk-Light.otf +0 -0
- {tesorotools_python-0.0.10 → tesorotools_python-0.0.12}/tesorotools/assets/fonts/CabinetGrotesk-Medium.otf +0 -0
- {tesorotools_python-0.0.10 → tesorotools_python-0.0.12}/tesorotools/assets/fonts/CabinetGrotesk-Regular.otf +0 -0
- {tesorotools_python-0.0.10 → tesorotools_python-0.0.12}/tesorotools/assets/fonts/CabinetGrotesk-Thin.otf +0 -0
- {tesorotools_python-0.0.10 → tesorotools_python-0.0.12}/tesorotools/assets/fonts/README.md +0 -0
- {tesorotools_python-0.0.10 → tesorotools_python-0.0.12}/tesorotools/assets/plots.yaml +0 -0
- {tesorotools_python-0.0.10 → tesorotools_python-0.0.12}/tesorotools/assets/tesoro.mplstyle +0 -0
- {tesorotools_python-0.0.10 → tesorotools_python-0.0.12}/tesorotools/convert.py +0 -0
- {tesorotools_python-0.0.10 → tesorotools_python-0.0.12}/tesorotools/data_sources/README.md +0 -0
- {tesorotools_python-0.0.10 → tesorotools_python-0.0.12}/tesorotools/data_sources/__init__.py +0 -0
- {tesorotools_python-0.0.10 → tesorotools_python-0.0.12}/tesorotools/data_sources/debug.py +0 -0
- {tesorotools_python-0.0.10 → tesorotools_python-0.0.12}/tesorotools/data_sources/lseg.py +0 -0
- {tesorotools_python-0.0.10 → tesorotools_python-0.0.12}/tesorotools/database/__init__.py +0 -0
- {tesorotools_python-0.0.10 → tesorotools_python-0.0.12}/tesorotools/database/push.py +0 -0
- {tesorotools_python-0.0.10 → tesorotools_python-0.0.12}/tesorotools/dependencies/__init__.py +0 -0
- {tesorotools_python-0.0.10 → tesorotools_python-0.0.12}/tesorotools/dependencies/functions.py +0 -0
- {tesorotools_python-0.0.10 → tesorotools_python-0.0.12}/tesorotools/dependencies/node.py +0 -0
- {tesorotools_python-0.0.10 → tesorotools_python-0.0.12}/tesorotools/dependencies/resolution.py +0 -0
- {tesorotools_python-0.0.10 → tesorotools_python-0.0.12}/tesorotools/main.py +0 -0
- {tesorotools_python-0.0.10 → tesorotools_python-0.0.12}/tesorotools/offsets/__init__.py +0 -0
- {tesorotools_python-0.0.10 → tesorotools_python-0.0.12}/tesorotools/offsets/offsets.py +0 -0
- {tesorotools_python-0.0.10 → tesorotools_python-0.0.12}/tesorotools/offsets/outliers.py +0 -0
- {tesorotools_python-0.0.10 → tesorotools_python-0.0.12}/tesorotools/render/content/__init__.py +0 -0
- {tesorotools_python-0.0.10 → tesorotools_python-0.0.12}/tesorotools/render/content/content.py +0 -0
- {tesorotools_python-0.0.10 → tesorotools_python-0.0.12}/tesorotools/render/content/images.py +0 -0
- {tesorotools_python-0.0.10 → tesorotools_python-0.0.12}/tesorotools/render/content/section.py +0 -0
- {tesorotools_python-0.0.10 → tesorotools_python-0.0.12}/tesorotools/render/headline.py +0 -0
- {tesorotools_python-0.0.10 → tesorotools_python-0.0.12}/tesorotools/render/introduction.py +0 -0
- {tesorotools_python-0.0.10 → tesorotools_python-0.0.12}/tesorotools/render/report.py +0 -0
- {tesorotools_python-0.0.10 → tesorotools_python-0.0.12}/tesorotools/utils/__init__.py +0 -0
- {tesorotools_python-0.0.10 → tesorotools_python-0.0.12}/tesorotools/utils/config.py +0 -0
- {tesorotools_python-0.0.10 → tesorotools_python-0.0.12}/tesorotools/utils/globals.py +0 -0
- {tesorotools_python-0.0.10 → tesorotools_python-0.0.12}/tesorotools/utils/matplotlib.py +0 -0
- {tesorotools_python-0.0.10 → tesorotools_python-0.0.12}/tesorotools/utils/series.py +0 -0
- {tesorotools_python-0.0.10 → tesorotools_python-0.0.12}/tesorotools/utils/template.py +0 -0
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
from tesorotools.render.content.images import Image, Images
|
|
2
2
|
from tesorotools.render.content.section import Section
|
|
3
3
|
from tesorotools.render.content.table import Table
|
|
4
|
+
from tesorotools.render.content.text import Text
|
|
4
5
|
from tesorotools.render.report import Report
|
|
5
6
|
from tesorotools.utils.template import TemplateLoader
|
|
6
7
|
|
|
@@ -9,3 +10,4 @@ TemplateLoader.add_constructor("!section", Section.from_yaml)
|
|
|
9
10
|
TemplateLoader.add_constructor("!image", Image.from_yaml)
|
|
10
11
|
TemplateLoader.add_constructor("!images", Images.from_yaml)
|
|
11
12
|
TemplateLoader.add_constructor("!table", Table.from_yaml)
|
|
13
|
+
TemplateLoader.add_constructor("!text", Text.from_yaml)
|
|
@@ -192,8 +192,12 @@ def _fill_content(
|
|
|
192
192
|
for (x, y), value in np.ndenumerate(values):
|
|
193
193
|
cell: TableCell = table_docx.cell(x + start_row, y + 1)
|
|
194
194
|
cell.text = value if value is not None else ""
|
|
195
|
-
color: str | None =
|
|
196
|
-
|
|
195
|
+
color: str | None = (
|
|
196
|
+
color_table.values[x, y] if color_table is not None else None
|
|
197
|
+
)
|
|
198
|
+
shade: str | None = (
|
|
199
|
+
shade_table.values[x, y] if shade_table is not None else None
|
|
200
|
+
)
|
|
197
201
|
if color is not None:
|
|
198
202
|
cell.paragraphs[0].runs[0].font.color.rgb = RGBColor.from_string(
|
|
199
203
|
color
|
|
@@ -239,9 +243,9 @@ class Table:
|
|
|
239
243
|
|
|
240
244
|
def __init__(
|
|
241
245
|
self,
|
|
242
|
-
data_file: Path | None,
|
|
243
|
-
color_file: Path | None,
|
|
244
|
-
shade_file: Path | None,
|
|
246
|
+
data_file: Path | None = None,
|
|
247
|
+
color_file: Path | None = None,
|
|
248
|
+
shade_file: Path | None = None,
|
|
245
249
|
block_sep: bool = False,
|
|
246
250
|
title: str | None = None,
|
|
247
251
|
):
|
|
@@ -271,7 +275,12 @@ class Table:
|
|
|
271
275
|
data_file: Path = root_path / f"{file_prefix}_data.feather"
|
|
272
276
|
color_file: Path = root_path / f"{file_prefix}_color.feather"
|
|
273
277
|
shade_file: Path = root_path / f"{file_prefix}_shade.feather"
|
|
274
|
-
return cls(
|
|
278
|
+
return cls(
|
|
279
|
+
data_file,
|
|
280
|
+
color_file=color_file if color_file.exists() else None,
|
|
281
|
+
shade_file=shade_file if shade_file.exists() else None,
|
|
282
|
+
**table_cfg,
|
|
283
|
+
)
|
|
275
284
|
|
|
276
285
|
def render(self, document: Document) -> Document:
|
|
277
286
|
document = render_table(
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
from typing import Any, Self
|
|
2
|
+
|
|
3
|
+
from docx.document import Document
|
|
4
|
+
from yaml import Loader, MappingNode
|
|
5
|
+
|
|
6
|
+
from tesorotools.render.content.content import Content
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
class Text:
|
|
10
|
+
def __init__(self, text: str) -> None:
|
|
11
|
+
self._text = text
|
|
12
|
+
|
|
13
|
+
@classmethod
|
|
14
|
+
def from_yaml(cls, loader: Loader, node: MappingNode) -> Self:
|
|
15
|
+
values: dict[str, Any] = loader.construct_mapping(node, deep=True)
|
|
16
|
+
values.pop("id")
|
|
17
|
+
text: str = values.pop("text", None)
|
|
18
|
+
section: Self = cls(text=text)
|
|
19
|
+
return section
|
|
20
|
+
|
|
21
|
+
def render(self, document: Document) -> Document:
|
|
22
|
+
document.add_paragraph(self._text)
|
|
23
|
+
return document
|
|
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
|
{tesorotools_python-0.0.10 → tesorotools_python-0.0.12}/tesorotools/data_sources/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{tesorotools_python-0.0.10 → tesorotools_python-0.0.12}/tesorotools/dependencies/__init__.py
RENAMED
|
File without changes
|
{tesorotools_python-0.0.10 → tesorotools_python-0.0.12}/tesorotools/dependencies/functions.py
RENAMED
|
File without changes
|
|
File without changes
|
{tesorotools_python-0.0.10 → tesorotools_python-0.0.12}/tesorotools/dependencies/resolution.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{tesorotools_python-0.0.10 → tesorotools_python-0.0.12}/tesorotools/render/content/__init__.py
RENAMED
|
File without changes
|
{tesorotools_python-0.0.10 → tesorotools_python-0.0.12}/tesorotools/render/content/content.py
RENAMED
|
File without changes
|
{tesorotools_python-0.0.10 → tesorotools_python-0.0.12}/tesorotools/render/content/images.py
RENAMED
|
File without changes
|
{tesorotools_python-0.0.10 → tesorotools_python-0.0.12}/tesorotools/render/content/section.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
|