luxorasap 0.2.8__py3-none-any.whl → 0.2.9__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.8"
16
+ __version__ = "0.2.9"
17
17
 
18
18
  # ─── Lazy loader ─────────────────────────────────────────────────
19
19
  def __getattr__(name: str) -> ModuleType:
@@ -140,22 +140,44 @@ class TableDataLoader:
140
140
  self.tracked_files[directory] = blob_watcher
141
141
 
142
142
 
143
- def table_load_triggered(self) -> bool:
144
- """Verifica se alguma das trigger tables foi atualizada."""
145
-
146
- load_triggered = False
147
- # Verificando se alguma das tabelas foi atualizada
148
- for trigger_path in self.tracked_files.keys():
149
- blob_watcher = self.tracked_files[trigger_path]
150
- file_updated, _, _ = blob_watcher.has_changed(blob_path = trigger_path,
151
- update_snapshot=True,
152
- treat_missing_as_changed=True
153
- )
154
- if file_updated:
155
- load_triggered = True #load_triggered | True
156
-
157
- return load_triggered
158
-
143
+ def table_load_triggered(self, trigger_mode="any") -> bool:
144
+ """Verifica se alguma das trigger tables foi atualizada.
145
+ trigger_mode: "any" ou "all".
146
+ """
147
+
148
+ if trigger_mode == "any":
149
+ load_triggered = False
150
+ # Verificando se alguma das tabelas foi atualizada
151
+ for trigger_path in self.tracked_files.keys():
152
+ blob_watcher = self.tracked_files[trigger_path]
153
+ file_updated, _, _ = blob_watcher.has_changed(blob_path = trigger_path,
154
+ update_snapshot=True,
155
+ treat_missing_as_changed=True
156
+ )
157
+ if file_updated:
158
+ load_triggered = True #load_triggered | True
159
+
160
+ return load_triggered
161
+
162
+ if trigger_mode == "all":
163
+ load_triggered = True
164
+ # Verificando se alguma das tabelas foi atualizada
165
+ for trigger_path in self.tracked_files.keys():
166
+ blob_watcher = self.tracked_files[trigger_path]
167
+ file_updated, _, _ = blob_watcher.has_changed(blob_path = trigger_path,
168
+ update_snapshot=False,
169
+ treat_missing_as_changed=True
170
+ )
171
+ if not file_updated:
172
+ load_triggered = False #load_triggered | True
173
+ if load_triggered:
174
+ # Fazer do estado dos snapshots
175
+ for trigger_path in self.tracked_files.keys():
176
+ blob_watcher = self.tracked_files[trigger_path]
177
+ blob_watcher.update_snapshot(trigger_path)
178
+ return load_triggered
179
+
180
+
159
181
 
160
182
  def load_table(self):
161
183
  """Carrega a tabela via funcao de atualização.
@@ -294,55 +294,4 @@ class BlobChangeWatcher:
294
294
  return changed_paths
295
295
 
296
296
 
297
- class TableDataLoader:
298
297
 
299
- def __init__(self, update_func: callable, kwargs: dict = {}, adls_connection_string: str = None ):
300
- """
301
- Controla o carregamento de tabelas baseado em mudanças de arquivos no ADLS.
302
- Args:
303
- update_func (callable): Funcao que sera chamada para atualizar a tabela.
304
- kwargs (dict): Dicionario com os argumentos para a funcao de update.
305
- luxordb_path (Path, optional): Caminho para o diretorio raiz do luxorDB.
306
- Defaults to None.
307
- """
308
- self.tracked_files = {}
309
- self.adls_connection_string = adls_connection_string
310
- self.update_func = update_func
311
- self.kwargs = kwargs
312
-
313
-
314
- def add_load_trigger(self, directory: str, trigger_name: str):
315
- """ Adiciona tabela na lista para controle de alteracao.
316
- O load sera disparado quando essa tabela for atualizada.
317
- Args:
318
- table_path (Path): Path para a tabela que ira disparar a atualizacao.
319
- """
320
-
321
- blob_watcher = BlobChangeWatcher(watcher_id=trigger_name,
322
- adls_connection_string=self.adls_connection_string)
323
- self.tracked_files[directory] = blob_watcher
324
-
325
-
326
- def table_load_triggered(self) -> bool:
327
- """Verifica se alguma das trigger tables foi atualizada."""
328
-
329
- load_triggered = False
330
- # Verificando se alguma das tabelas foi atualizada
331
- for trigger_path in self.tracked_files.keys():
332
- blob_watcher = self.tracked_files[trigger_path]
333
- file_updated, _, _ = blob_watcher.has_changed(blob_path = trigger_path,
334
- update_snapshot=True,
335
- treat_missing_as_changed=True
336
- )
337
- if file_updated:
338
- load_triggered = True #load_triggered | True
339
-
340
- return load_triggered
341
-
342
-
343
- def load_table(self):
344
- """Carrega a tabela no luxorDB.
345
- Args:
346
- kwargs (dict): Dicionario com os argumentos para a funcao de update.
347
- """
348
- self.update_func(**self.kwargs)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: luxorasap
3
- Version: 0.2.8
3
+ Version: 0.2.9
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=rXkCotxvChyTQ7BUA0jKYHl3xS_6uscTgEUWY6jn5VE,1355
1
+ luxorasap/__init__.py,sha256=nfvTT0PKUYysJeHqZn43FAn0ko6plZvDSuvpmK_wM94,1355
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=6yVxOHTVuauWWIL1s_-cuFfpJjVCRXlzUjg4VIVIQ94,157771
8
8
  luxorasap/ingest/__init__.py,sha256=gHkw8FU8TuRL5tfHkACxwsLHwLYX8SgX9xHkB8uTjww,831
9
- luxorasap/ingest/cloud/__init__.py,sha256=F4VQLU2h7z1fwOhoBVM5W-8b3aABjYeyj6UsmpmtWD0,6059
9
+ luxorasap/ingest/cloud/__init__.py,sha256=I0JZh9FbGnIVxu7VmiTXe8rKN_w5OWLULvkVkVZNeUk,7242
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
@@ -14,11 +14,11 @@ luxorasap/utils/dataframe/reader.py,sha256=Vzjdw-AeS1lnWEHQ8RZNh0kK93NWTp0NWVi_B
14
14
  luxorasap/utils/dataframe/transforms.py,sha256=OIvlTTcjFX6bUhuQp_syEp7ssm4sLzwvgsag6n2Wl3k,2438
15
15
  luxorasap/utils/storage/__init__.py,sha256=461GYJcPMXGjHuJ9y9D3BHOC_oUS9Re32nVu1AwKyIA,334
16
16
  luxorasap/utils/storage/blob.py,sha256=vgCKMOiVgP-V1A2xZRhG3kJhPFU-LA9E9kddOQTxYD8,9443
17
- luxorasap/utils/storage/change_tracker.py,sha256=u0oQxqnc63AQXWJ2_FS-R3Nu4olhOgwsnJVwpxwRAn4,13962
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.8.dist-info/METADATA,sha256=eEw_aU1ok4OirGqqWNy-V5vTlu5k5R-_Ypc08SviZN0,3803
21
- luxorasap-0.2.8.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
22
- luxorasap-0.2.8.dist-info/entry_points.txt,sha256=XFh-dOwUhlya9DmGvgookMI0ezyUJjcOvTIHDEYS44g,52
23
- luxorasap-0.2.8.dist-info/top_level.txt,sha256=9YOL6bUIpzY06XFBRkUW1e4rgB32Ds91fQPGwUEjxzU,10
24
- luxorasap-0.2.8.dist-info/RECORD,,
20
+ luxorasap-0.2.9.dist-info/METADATA,sha256=Abau4A8rUCSCBUwYPr9L9cbyZzTtxLR3cn27_qEfomI,3803
21
+ luxorasap-0.2.9.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
22
+ luxorasap-0.2.9.dist-info/entry_points.txt,sha256=XFh-dOwUhlya9DmGvgookMI0ezyUJjcOvTIHDEYS44g,52
23
+ luxorasap-0.2.9.dist-info/top_level.txt,sha256=9YOL6bUIpzY06XFBRkUW1e4rgB32Ds91fQPGwUEjxzU,10
24
+ luxorasap-0.2.9.dist-info/RECORD,,