luxorasap 0.1.6__tar.gz → 0.1.7__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.
- {luxorasap-0.1.6 → luxorasap-0.1.7}/PKG-INFO +1 -1
- {luxorasap-0.1.6 → luxorasap-0.1.7}/pyproject.toml +2 -2
- {luxorasap-0.1.6 → luxorasap-0.1.7}/src/luxorasap/__init__.py +1 -1
- {luxorasap-0.1.6 → luxorasap-0.1.7}/src/luxorasap/btgapi/reports.py +4 -3
- {luxorasap-0.1.6 → luxorasap-0.1.7}/src/luxorasap/ingest/cloud/__init__.py +8 -0
- {luxorasap-0.1.6 → luxorasap-0.1.7}/src/luxorasap.egg-info/PKG-INFO +1 -1
- {luxorasap-0.1.6 → luxorasap-0.1.7}/README.md +0 -0
- {luxorasap-0.1.6 → luxorasap-0.1.7}/setup.cfg +0 -0
- {luxorasap-0.1.6 → luxorasap-0.1.7}/src/luxorasap/btgapi/__init__.py +0 -0
- {luxorasap-0.1.6 → luxorasap-0.1.7}/src/luxorasap/btgapi/auth.py +0 -0
- {luxorasap-0.1.6 → luxorasap-0.1.7}/src/luxorasap/btgapi/trades.py +0 -0
- {luxorasap-0.1.6 → luxorasap-0.1.7}/src/luxorasap/datareader/__init__.py +0 -0
- {luxorasap-0.1.6 → luxorasap-0.1.7}/src/luxorasap/datareader/core.py +0 -0
- {luxorasap-0.1.6 → luxorasap-0.1.7}/src/luxorasap/ingest/__init__.py +0 -0
- {luxorasap-0.1.6 → luxorasap-0.1.7}/src/luxorasap/ingest/legacy_local/dataloader.py +0 -0
- {luxorasap-0.1.6 → luxorasap-0.1.7}/src/luxorasap/utils/__init__.py +0 -0
- {luxorasap-0.1.6 → luxorasap-0.1.7}/src/luxorasap/utils/dataframe/__init__.py +0 -0
- {luxorasap-0.1.6 → luxorasap-0.1.7}/src/luxorasap/utils/dataframe/reader.py +0 -0
- {luxorasap-0.1.6 → luxorasap-0.1.7}/src/luxorasap/utils/dataframe/transforms.py +0 -0
- {luxorasap-0.1.6 → luxorasap-0.1.7}/src/luxorasap/utils/storage/__init__.py +0 -0
- {luxorasap-0.1.6 → luxorasap-0.1.7}/src/luxorasap/utils/storage/blob.py +0 -0
- {luxorasap-0.1.6 → luxorasap-0.1.7}/src/luxorasap.egg-info/SOURCES.txt +0 -0
- {luxorasap-0.1.6 → luxorasap-0.1.7}/src/luxorasap.egg-info/dependency_links.txt +0 -0
- {luxorasap-0.1.6 → luxorasap-0.1.7}/src/luxorasap.egg-info/entry_points.txt +0 -0
- {luxorasap-0.1.6 → luxorasap-0.1.7}/src/luxorasap.egg-info/requires.txt +0 -0
- {luxorasap-0.1.6 → luxorasap-0.1.7}/src/luxorasap.egg-info/top_level.txt +0 -0
- {luxorasap-0.1.6 → luxorasap-0.1.7}/tests/test_btgapi_auth.py +0 -0
- {luxorasap-0.1.6 → luxorasap-0.1.7}/tests/test_btgapi_reports.py +0 -0
- {luxorasap-0.1.6 → luxorasap-0.1.7}/tests/test_btgapi_trades.py +0 -0
- {luxorasap-0.1.6 → luxorasap-0.1.7}/tests/test_datareader.py +0 -0
- {luxorasap-0.1.6 → luxorasap-0.1.7}/tests/test_ingest_cloud.py +0 -0
- {luxorasap-0.1.6 → luxorasap-0.1.7}/tests/test_ingest_legacy_local.py +0 -0
- {luxorasap-0.1.6 → luxorasap-0.1.7}/tests/test_utils_dataframe.py +0 -0
- {luxorasap-0.1.6 → luxorasap-0.1.7}/tests/test_utils_storage.py +0 -0
|
@@ -10,7 +10,7 @@ build-backend = "setuptools.build_meta"
|
|
|
10
10
|
#############################
|
|
11
11
|
[project]
|
|
12
12
|
name = "luxorasap"
|
|
13
|
-
version = "0.1.
|
|
13
|
+
version = "0.1.7"
|
|
14
14
|
description = "Toolbox da Luxor para ingestão, análise e automação de dados financeiros."
|
|
15
15
|
readme = "README.md"
|
|
16
16
|
requires-python = ">=3.9"
|
|
@@ -78,7 +78,7 @@ exclude = ["tests*"]
|
|
|
78
78
|
# bumpver (sem-ver)
|
|
79
79
|
#############################
|
|
80
80
|
[tool.bumpver]
|
|
81
|
-
current_version = "0.1.
|
|
81
|
+
current_version = "0.1.7"
|
|
82
82
|
version_pattern = "MAJOR.MINOR.PATCH"
|
|
83
83
|
|
|
84
84
|
# regex explícito – obrigatório no bumpver 2024+
|
|
@@ -13,7 +13,7 @@ from types import ModuleType
|
|
|
13
13
|
try:
|
|
14
14
|
__version__: str = metadata.version(__name__)
|
|
15
15
|
except metadata.PackageNotFoundError: # editable install
|
|
16
|
-
__version__ = "0.1.
|
|
16
|
+
__version__ = "0.1.7"
|
|
17
17
|
|
|
18
18
|
# ─── Lazy loader ─────────────────────────────────────────────────
|
|
19
19
|
def __getattr__(name: str) -> ModuleType:
|
|
@@ -96,8 +96,9 @@ def check_report_ticket(token: str, ticket: str, *, page: Optional[int] = None)
|
|
|
96
96
|
|
|
97
97
|
result = payload.get("result")
|
|
98
98
|
|
|
99
|
-
if result
|
|
100
|
-
|
|
99
|
+
if isinstance(result, str):
|
|
100
|
+
if (result.lower() in "processando") or ('process' in result.lower()):
|
|
101
|
+
raise BTGApiError("Processando")
|
|
101
102
|
|
|
102
103
|
# 3. Quando pronto, result é JSON string com UrlDownload
|
|
103
104
|
if isinstance(result, str):
|
|
@@ -117,7 +118,7 @@ def check_report_ticket(token: str, ticket: str, *, page: Optional[int] = None)
|
|
|
117
118
|
except Exception as exc:
|
|
118
119
|
raise BTGApiError(f"Falha ao converter resultado em DataFrame: {exc}") from exc
|
|
119
120
|
|
|
120
|
-
raise BTGApiError("Formato de resposta desconhecido")
|
|
121
|
+
raise BTGApiError(f"Formato de resposta desconhecido. Resultado:\n{result}")
|
|
121
122
|
|
|
122
123
|
|
|
123
124
|
def await_report_ticket_result(token: str, ticket: str, *, attempts: int = 10,
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"""Camada moderna de ingestão: grava / incrementa tabelas em ADLS (Parquet)."""
|
|
2
2
|
|
|
3
3
|
import pandas as pd
|
|
4
|
+
import datetime as dt
|
|
4
5
|
|
|
5
6
|
from luxorasap.utils.storage import BlobParquetClient
|
|
6
7
|
from luxorasap.utils.dataframe import prep_for_save
|
|
@@ -24,6 +25,9 @@ def save_table(
|
|
|
24
25
|
):
|
|
25
26
|
"""Salva DataFrame como Parquet em ADLS (sobrescrevendo)."""
|
|
26
27
|
|
|
28
|
+
if 'Last_Updated' not in df.columns:
|
|
29
|
+
df['Last_Updated'] = dt.datetime.now()
|
|
30
|
+
|
|
27
31
|
if override == False:
|
|
28
32
|
lq = LuxorQuery()
|
|
29
33
|
if lq.table_exists(table_name):
|
|
@@ -43,8 +47,11 @@ def incremental_load(
|
|
|
43
47
|
index_name: str = "index",
|
|
44
48
|
normalize_columns: bool = True,
|
|
45
49
|
directory: str = "enriched/parquet",
|
|
50
|
+
override = False
|
|
46
51
|
):
|
|
47
52
|
"""Concatena novos dados aos existentes, cortando duplicados pela data."""
|
|
53
|
+
df["Last_Updated"] = dt.datetime.now()
|
|
54
|
+
|
|
48
55
|
if lq.table_exists(table_name):
|
|
49
56
|
prev = lq.get_table(table_name)
|
|
50
57
|
cutoff = df[increment_column].max()
|
|
@@ -58,4 +65,5 @@ def incremental_load(
|
|
|
58
65
|
index_name=index_name,
|
|
59
66
|
normalize_columns=normalize_columns,
|
|
60
67
|
directory=directory,
|
|
68
|
+
override=override
|
|
61
69
|
)
|
|
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
|