luxorasap 0.2.14__py3-none-any.whl → 0.2.15__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.
luxorasap/__init__.py CHANGED
@@ -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.2.14"
16
+ __version__ = "0.2.15"
17
17
 
18
18
  # ─── Lazy loader ─────────────────────────────────────────────────
19
19
  def __getattr__(name: str) -> ModuleType:
@@ -14,8 +14,6 @@ from luxorasap.utils.storage import BlobChangeWatcher
14
14
  __all__ = ["save_table", "incremental_load"]
15
15
 
16
16
  _client = BlobParquetClient() # instância única para o módulo
17
- _client_excel = None
18
- _client_pickle = None
19
17
 
20
18
 
21
19
  # ────────────────────────────────────────────────────────────────
@@ -30,7 +28,17 @@ def save_table(
30
28
  override=False,
31
29
  format='parquet'
32
30
  ):
33
- """Salva DataFrame como Parquet em ADLS (sobrescrevendo)."""
31
+ """Salva DataFrame como arquivo Parquet no ADLS.
32
+ Args:
33
+ table_name (str): Nome da tabela (será o nome do arquivo).
34
+ df (pd.DataFrame): DataFrame a ser salvo.
35
+ index (bool, optional): Se True, salva o índice do DataFrame. Defaults to False.
36
+ index_name (str, optional): Nome da coluna de índice, se `index` for True. Defaults to "index".
37
+ normalize_columns (bool, optional): Se True, normaliza nomes de colunas. Defaults to True.
38
+ directory (str, optional): Subdiretório no container 'luxorasap'. Defaults to "enriched/parquet".
39
+ override (bool, optional): Se True, sobrescreve a tabela existente. Defaults to False.
40
+ format (str): Formato de saída ('parquet', 'excel', 'excel_multiple_sheets', 'pickle'). Defaults to 'parquet'.
41
+ """
34
42
 
35
43
  if 'Last_Updated' not in df.columns:
36
44
  df['Last_Updated'] = dt.datetime.now()
@@ -54,17 +62,14 @@ def save_table(
54
62
  _client.write_df(df, f"{directory}/{table_name}.parquet")
55
63
 
56
64
  elif format == 'excel':
57
- global _client_excel
58
- if _client_excel is None:
59
- _client_excel = BlobExcelClient()
65
+
66
+ _client_excel = BlobExcelClient()
60
67
  if index:
61
68
  df = df.reset_index().rename(columns={"index": index_name})
62
69
  _client_excel.write_excel(df, f"{directory}/{table_name}.xlsx")
63
70
 
64
71
  elif format == 'excel_multiple_sheets':
65
- global _client_excel
66
- if _client_excel is None:
67
- _client_excel = BlobExcelClient()
72
+ _client_excel = BlobExcelClient()
68
73
  # df neste caso é um dicionário de DataFrames
69
74
  _client_excel.write_excel_multiple_sheets(df, f"{directory}/{table_name}.xlsx")
70
75
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: luxorasap
3
- Version: 0.2.14
3
+ Version: 0.2.15
4
4
  Summary: Toolbox da Luxor para ingestão, análise e automação de dados financeiros.
5
5
  Author-email: Luxor Group <backoffice@luxor.com.br>
6
6
  License: Proprietary – All rights reserved
@@ -1,4 +1,4 @@
1
- luxorasap/__init__.py,sha256=xDbLsrCmxU8ikmmC0bupvVN_t_PEOd9NrREMfq9AH9I,1356
1
+ luxorasap/__init__.py,sha256=EgzOnwtt5Zmu-zgJjOa_pfJpYbsaaMqYQqv7wAE-OOQ,1356
2
2
  luxorasap/btgapi/__init__.py,sha256=QUlfb5oiBY6K1Q5x4-a-x2wECe1At5wc2962I5odOJk,620
3
3
  luxorasap/btgapi/auth.py,sha256=PvyCtbEyBO2B1CIeAlNXWugKW1OgiKfPcVzS6K5FBnQ,1872
4
4
  luxorasap/btgapi/reports.py,sha256=ZVEMLoJPXc0r3XjPJPMsKQN0zZd1Npd7umNpAj1bncs,8040
@@ -6,7 +6,7 @@ luxorasap/btgapi/trades.py,sha256=956HZ9BvN9C_VQvKTyBLN0x6ZygwVqBZN11F7OnNbDI,59
6
6
  luxorasap/datareader/__init__.py,sha256=41RAvbrQ4R6oj67S32CrKqolx0CJ2W8cbOF6g5Cqm2g,120
7
7
  luxorasap/datareader/core.py,sha256=D7nNdKiu5VAii4xWnoqO1PR0qaYi3YEfKyxhkVGZ1j8,158784
8
8
  luxorasap/ingest/__init__.py,sha256=gHkw8FU8TuRL5tfHkACxwsLHwLYX8SgX9xHkB8uTjww,831
9
- luxorasap/ingest/cloud/__init__.py,sha256=zoepoVcXNFtVj62aUyqu9AY7u6vX0RIKRWDfXOn2J4Q,7548
9
+ luxorasap/ingest/cloud/__init__.py,sha256=5GoXqMSKdTTqltWWqbgLjdQODx1zn0r-NYkTyk0Qrzo,8121
10
10
  luxorasap/ingest/legacy_local/dataloader.py,sha256=DF3CvojDAi0itVDZPsQbmpl5pqMTNwOOpxTz4Ju8mho,12419
11
11
  luxorasap/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
12
12
  luxorasap/utils/dataframe/__init__.py,sha256=heKpmq58FmX35syzzwrHqlOWKYBkH2Z1jyqaQ_Vg-00,265
@@ -17,8 +17,8 @@ luxorasap/utils/storage/blob.py,sha256=28bsUbEUjg_LapDZ4P3kWkxHDQGNXv_Jik49RfXbw
17
17
  luxorasap/utils/storage/change_tracker.py,sha256=HkeKc62UyD2BtP2gqafnJHZSBvYreH_7SQI1CYhn3Us,11709
18
18
  luxorasap/utils/tools/__init__.py,sha256=dvK7Z4xnNQAuEiObVN7qjeLWAvP49JeFn2Oq9GdgmXs,76
19
19
  luxorasap/utils/tools/excel.py,sha256=SfeTcbJWsWq3uKruwKSjJ4aWgMovITzlNXjP2bhdMjI,1246
20
- luxorasap-0.2.14.dist-info/METADATA,sha256=smLlV2FPeq9rNwPCAgNb2AYfy6tPqMLlKlE78kJUoaw,3804
21
- luxorasap-0.2.14.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
22
- luxorasap-0.2.14.dist-info/entry_points.txt,sha256=XFh-dOwUhlya9DmGvgookMI0ezyUJjcOvTIHDEYS44g,52
23
- luxorasap-0.2.14.dist-info/top_level.txt,sha256=9YOL6bUIpzY06XFBRkUW1e4rgB32Ds91fQPGwUEjxzU,10
24
- luxorasap-0.2.14.dist-info/RECORD,,
20
+ luxorasap-0.2.15.dist-info/METADATA,sha256=fOzsDmQfol8v6dHkNSzdbjSIotjAIC4W1Zy8r_jWGSE,3804
21
+ luxorasap-0.2.15.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
22
+ luxorasap-0.2.15.dist-info/entry_points.txt,sha256=XFh-dOwUhlya9DmGvgookMI0ezyUJjcOvTIHDEYS44g,52
23
+ luxorasap-0.2.15.dist-info/top_level.txt,sha256=9YOL6bUIpzY06XFBRkUW1e4rgB32Ds91fQPGwUEjxzU,10
24
+ luxorasap-0.2.15.dist-info/RECORD,,