tesorotools-python 0.0.17__tar.gz → 0.0.19__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.17 → tesorotools_python-0.0.19}/PKG-INFO +2 -1
- {tesorotools_python-0.0.17 → tesorotools_python-0.0.19}/pyproject.toml +2 -1
- tesorotools_python-0.0.19/tesorotools/database/__init__.py +1 -0
- tesorotools_python-0.0.19/tesorotools/database/local.py +46 -0
- tesorotools_python-0.0.19/tesorotools/utils/__init__.py +1 -0
- {tesorotools_python-0.0.17 → tesorotools_python-0.0.19}/tesorotools/utils/globals.py +4 -0
- {tesorotools_python-0.0.17 → tesorotools_python-0.0.19}/tesorotools/utils/shortcuts.py +0 -1
- tesorotools_python-0.0.17/tesorotools/render/content/__init__.py +0 -0
- tesorotools_python-0.0.17/tesorotools/utils/__init__.py +0 -0
- {tesorotools_python-0.0.17 → tesorotools_python-0.0.19}/.gitignore +0 -0
- {tesorotools_python-0.0.17 → tesorotools_python-0.0.19}/tesorotools/__init__.py +0 -0
- {tesorotools_python-0.0.17 → tesorotools_python-0.0.19}/tesorotools/artists/__init__.py +0 -0
- {tesorotools_python-0.0.17 → tesorotools_python-0.0.19}/tesorotools/artists/barh_plot.py +0 -0
- {tesorotools_python-0.0.17 → tesorotools_python-0.0.19}/tesorotools/artists/line_plot.py +0 -0
- {tesorotools_python-0.0.17 → tesorotools_python-0.0.19}/tesorotools/artists/table.py +0 -0
- {tesorotools_python-0.0.17 → tesorotools_python-0.0.19}/tesorotools/artists/type_curve.py +0 -0
- {tesorotools_python-0.0.17 → tesorotools_python-0.0.19}/tesorotools/assets/README.md +0 -0
- {tesorotools_python-0.0.17 → tesorotools_python-0.0.19}/tesorotools/assets/fonts/CabinetGrotesk-Black.otf +0 -0
- {tesorotools_python-0.0.17 → tesorotools_python-0.0.19}/tesorotools/assets/fonts/CabinetGrotesk-Bold.otf +0 -0
- {tesorotools_python-0.0.17 → tesorotools_python-0.0.19}/tesorotools/assets/fonts/CabinetGrotesk-Extrabold.otf +0 -0
- {tesorotools_python-0.0.17 → tesorotools_python-0.0.19}/tesorotools/assets/fonts/CabinetGrotesk-Extralight.otf +0 -0
- {tesorotools_python-0.0.17 → tesorotools_python-0.0.19}/tesorotools/assets/fonts/CabinetGrotesk-Light.otf +0 -0
- {tesorotools_python-0.0.17 → tesorotools_python-0.0.19}/tesorotools/assets/fonts/CabinetGrotesk-Medium.otf +0 -0
- {tesorotools_python-0.0.17 → tesorotools_python-0.0.19}/tesorotools/assets/fonts/CabinetGrotesk-Regular.otf +0 -0
- {tesorotools_python-0.0.17 → tesorotools_python-0.0.19}/tesorotools/assets/fonts/CabinetGrotesk-Thin.otf +0 -0
- {tesorotools_python-0.0.17 → tesorotools_python-0.0.19}/tesorotools/assets/fonts/README.md +0 -0
- {tesorotools_python-0.0.17 → tesorotools_python-0.0.19}/tesorotools/assets/plots.yaml +0 -0
- {tesorotools_python-0.0.17 → tesorotools_python-0.0.19}/tesorotools/assets/tesoro.mplstyle +0 -0
- {tesorotools_python-0.0.17 → tesorotools_python-0.0.19}/tesorotools/convert.py +0 -0
- {tesorotools_python-0.0.17 → tesorotools_python-0.0.19}/tesorotools/data_sources/README.md +0 -0
- {tesorotools_python-0.0.17 → tesorotools_python-0.0.19}/tesorotools/data_sources/__init__.py +0 -0
- {tesorotools_python-0.0.17 → tesorotools_python-0.0.19}/tesorotools/data_sources/debug.py +0 -0
- {tesorotools_python-0.0.17 → tesorotools_python-0.0.19}/tesorotools/data_sources/lseg.py +0 -0
- {tesorotools_python-0.0.17 → tesorotools_python-0.0.19}/tesorotools/database/push.py +0 -0
- {tesorotools_python-0.0.17/tesorotools/database → tesorotools_python-0.0.19/tesorotools/dependencies}/__init__.py +0 -0
- {tesorotools_python-0.0.17 → tesorotools_python-0.0.19}/tesorotools/dependencies/functions.py +0 -0
- {tesorotools_python-0.0.17 → tesorotools_python-0.0.19}/tesorotools/dependencies/node.py +0 -0
- {tesorotools_python-0.0.17 → tesorotools_python-0.0.19}/tesorotools/dependencies/resolution.py +0 -0
- {tesorotools_python-0.0.17 → tesorotools_python-0.0.19}/tesorotools/main.py +0 -0
- {tesorotools_python-0.0.17/tesorotools/dependencies → tesorotools_python-0.0.19/tesorotools/offsets}/__init__.py +0 -0
- {tesorotools_python-0.0.17 → tesorotools_python-0.0.19}/tesorotools/offsets/offsets.py +0 -0
- {tesorotools_python-0.0.17 → tesorotools_python-0.0.19}/tesorotools/offsets/outliers.py +0 -0
- {tesorotools_python-0.0.17 → tesorotools_python-0.0.19}/tesorotools/render/__init__.py +0 -0
- {tesorotools_python-0.0.17/tesorotools/offsets → tesorotools_python-0.0.19/tesorotools/render/content}/__init__.py +0 -0
- {tesorotools_python-0.0.17 → tesorotools_python-0.0.19}/tesorotools/render/content/content.py +0 -0
- {tesorotools_python-0.0.17 → tesorotools_python-0.0.19}/tesorotools/render/content/images.py +0 -0
- {tesorotools_python-0.0.17 → tesorotools_python-0.0.19}/tesorotools/render/content/section.py +0 -0
- {tesorotools_python-0.0.17 → tesorotools_python-0.0.19}/tesorotools/render/content/subtitle.py +0 -0
- {tesorotools_python-0.0.17 → tesorotools_python-0.0.19}/tesorotools/render/content/table.py +0 -0
- {tesorotools_python-0.0.17 → tesorotools_python-0.0.19}/tesorotools/render/content/text.py +0 -0
- {tesorotools_python-0.0.17 → tesorotools_python-0.0.19}/tesorotools/render/content/title.py +0 -0
- {tesorotools_python-0.0.17 → tesorotools_python-0.0.19}/tesorotools/render/report.py +0 -0
- {tesorotools_python-0.0.17 → tesorotools_python-0.0.19}/tesorotools/utils/config.py +0 -0
- {tesorotools_python-0.0.17 → tesorotools_python-0.0.19}/tesorotools/utils/matplotlib.py +0 -0
- {tesorotools_python-0.0.17 → tesorotools_python-0.0.19}/tesorotools/utils/series.py +0 -0
- {tesorotools_python-0.0.17 → tesorotools_python-0.0.19}/tesorotools/utils/template.py +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
from tesorotools.database.local import LocalDatabase, ShortcutDatabase
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Este módulo trata de recoger todas las comunalidades de las bases de datos locales que tenemos en OneDrive, para estandarizar el trabajo con ellas y evitarnos dolores de cabeza en el futuro.
|
|
3
|
+
"""
|
|
4
|
+
|
|
5
|
+
from pathlib import Path
|
|
6
|
+
|
|
7
|
+
from tesorotools.utils import SYSTEM
|
|
8
|
+
from tesorotools.utils.shortcuts import resolve_shortcut
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class LocalDatabase:
|
|
12
|
+
"""
|
|
13
|
+
Todas las bases de datos locales que tenemos deben ser una instancia de esta, ya sea directamente o a través de una subclase
|
|
14
|
+
"""
|
|
15
|
+
|
|
16
|
+
def __init__(self, root_path: Path):
|
|
17
|
+
self.root_path: Path = root_path
|
|
18
|
+
|
|
19
|
+
def get_year_path(self, year: int) -> Path:
|
|
20
|
+
return self.root_path / str(year)
|
|
21
|
+
|
|
22
|
+
def get_raw_path(self, year: int) -> Path:
|
|
23
|
+
return self.get_year_path(year) / "raw"
|
|
24
|
+
|
|
25
|
+
def get_processed_path(self, year: int) -> Path:
|
|
26
|
+
processed_path: Path = self.get_year_path(year) / "processed"
|
|
27
|
+
processed_path.mkdir(parents=True, exist_ok=True)
|
|
28
|
+
return processed_path
|
|
29
|
+
|
|
30
|
+
def get_products_path(self, year: int) -> Path:
|
|
31
|
+
products_path: Path = self.get_year_path(year) / "products"
|
|
32
|
+
products_path.mkdir(parents=True, exist_ok=True)
|
|
33
|
+
return products_path
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
class ShortcutDatabase(LocalDatabase):
|
|
37
|
+
"""Base de datos local cuya ruta viene data a través de un acceso directo (Windows) o enlace simbólico (Linux)"""
|
|
38
|
+
|
|
39
|
+
def __init__(self, root_path: Path, shortcut: str):
|
|
40
|
+
db_path = (
|
|
41
|
+
root_path / f"{shortcut}.lnk"
|
|
42
|
+
if SYSTEM == "Windows"
|
|
43
|
+
else root_path / shortcut
|
|
44
|
+
)
|
|
45
|
+
db_resolved_path: Path = resolve_shortcut(db_path)
|
|
46
|
+
super().__init__(root_path=db_resolved_path)
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
from tesorotools.utils.globals import SYSTEM
|
|
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
|
{tesorotools_python-0.0.17 → tesorotools_python-0.0.19}/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.17 → tesorotools_python-0.0.19}/tesorotools/dependencies/functions.py
RENAMED
|
File without changes
|
|
File without changes
|
{tesorotools_python-0.0.17 → tesorotools_python-0.0.19}/tesorotools/dependencies/resolution.py
RENAMED
|
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.17 → tesorotools_python-0.0.19}/tesorotools/render/content/content.py
RENAMED
|
File without changes
|
{tesorotools_python-0.0.17 → tesorotools_python-0.0.19}/tesorotools/render/content/images.py
RENAMED
|
File without changes
|
{tesorotools_python-0.0.17 → tesorotools_python-0.0.19}/tesorotools/render/content/section.py
RENAMED
|
File without changes
|
{tesorotools_python-0.0.17 → tesorotools_python-0.0.19}/tesorotools/render/content/subtitle.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
|