luxorasap 0.1.1__py3-none-any.whl → 0.1.3__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.1.1"
16
+ __version__ = "0.1.3"
17
17
 
18
18
  # ─── Lazy loader ─────────────────────────────────────────────────
19
19
  def __getattr__(name: str) -> ModuleType:
@@ -1,7 +1,7 @@
1
1
  """Wrapper para as APIs do BTG Pactual."""
2
2
 
3
3
  from .auth import get_access_token, BTGApiError
4
- from .reports import request_portfolio, await_report_ticket_result, process_zip_to_dfs, request_investors_transactions_report
4
+ from .reports import request_portfolio, await_report_ticket_result, process_zip_to_dfs, request_investors_transactions_report, request_fundflow_report
5
5
  from .trades import submit_offshore_equity_trades, await_transaction_ticket_result
6
6
 
7
7
  __all__ = [
@@ -12,5 +12,6 @@ __all__ = [
12
12
  "submit_offshore_equity_trades",
13
13
  "await_transaction_ticket_result",
14
14
  "process_zip_to_dfs",
15
- "request_investors_transactions_report"
15
+ "request_investors_transactions_report",
16
+ "request_fundflow_report",
16
17
  ]
luxorasap/btgapi/auth.py CHANGED
@@ -52,6 +52,7 @@ def get_access_token(*, client_id=None, client_secret=None, test_env: bool = Tru
52
52
 
53
53
  if resp.ok:
54
54
  token = resp.json().get("access_token")
55
- logger.debug("Token BTG obtido (len=%s)", len(token) if token else "None")
55
+ len_token = len(token) if token else None
56
+ logger.debug(f"Token BTG obtido (len={len_token})")
56
57
  return token or ""
57
58
  raise BTGApiError(f"Falha ao autenticar: HTTP {resp.status_code} – {resp.text}")
@@ -16,7 +16,8 @@ __all__ = [
16
16
  "check_report_ticket",
17
17
  "await_report_ticket_result",
18
18
  "process_zip_to_dfs",
19
- "request_investors_transactions_report"
19
+ "request_investors_transactions_report",
20
+ "request_fundflow_report"
20
21
  ]
21
22
 
22
23
  _REPORT_ENDPOINT = "https://funds.btgpactual.com/reports/Portfolio"
@@ -24,6 +25,7 @@ _TICKET_ENDPOINT = "https://funds.btgpactual.com/reports/Ticket"
24
25
  _INVESTOR_TX_ENDPOINT = (
25
26
  "https://funds.btgpactual.com/reports/RTA/InvestorTransactionsFileReport"
26
27
  )
28
+ _FUNDFLOW_ENDPOINT = "https://funds.btgpactual.com/reports/RTA/FundFlow"
27
29
  _REPORT_TYPES = {"excel": 10, "xml5": 81, "pdf": 2}
28
30
 
29
31
 
@@ -93,7 +95,8 @@ def check_report_ticket(token: str, ticket: str, *, page: Optional[int] = None)
93
95
  # 2. Caso contrário tenta decodificar JSON
94
96
 
95
97
  result = payload.get("result")
96
- if result == "Processando":
98
+
99
+ if result == "Processando" or result == 'Aguardando processamento':
97
100
  raise BTGApiError("Processando")
98
101
 
99
102
  # 3. Quando pronto, result é JSON string com UrlDownload
@@ -103,7 +106,16 @@ def check_report_ticket(token: str, ticket: str, *, page: Optional[int] = None)
103
106
  url = info["UrlDownload"]
104
107
  return _download_url(url)
105
108
  except Exception as exc:
106
- raise BTGApiError(f"Falha ao interpretar result: {exc}") from exc
109
+ raise BTGApiError(f"Falha ao interpretar resultado: {exc}") from exc
110
+
111
+ # 4. result pode ser uma lista de dados
112
+ if isinstance(result, list):
113
+ # Vamos tentar transformar num dataframe e retornar
114
+ try:
115
+ df = pd.DataFrame(result)
116
+ return df
117
+ except Exception as exc:
118
+ raise BTGApiError(f"Falha ao converter resultado em DataFrame: {exc}") from exc
107
119
 
108
120
  raise BTGApiError("Formato de resposta desconhecido")
109
121
 
@@ -129,7 +141,7 @@ def await_report_ticket_result(token: str, ticket: str, *, attempts: int = 10,
129
141
  return check_report_ticket(token, ticket)
130
142
  except BTGApiError as err:
131
143
  if "Processando" in str(err):
132
- logger.debug("Ticket %s pendente (%d/%d)", ticket, i + 1, attempts)
144
+ logger.debug(f"Ticket {ticket} pendente ({i+1}/{attempts})")
133
145
  time.sleep(interval)
134
146
  continue
135
147
  raise
@@ -185,4 +197,43 @@ def request_investors_transactions_report( token: str, query_date: dt.date, *,
185
197
  return r.json()["ticket"]
186
198
  raise BTGApiError(
187
199
  f"Erro InvestorTransactionsFileReport: {r.status_code} – {r.text}"
188
- )
200
+ )
201
+
202
+
203
+ def request_fundflow_report( token: str, start_date: dt.date,
204
+ end_date: dt.date, *, fund_name: str = "", date_type: str = "LIQUIDACAO", page_size: int = 100) -> str:
205
+ """Dispara geração do **Fund Flow** (RTA) e devolve *ticket*.
206
+
207
+ Args:
208
+ token: JWT obtido via :pyfunc:`luxorasap.btgapi.get_access_token`.
209
+ start_date,end_date: Datas do intervalo desejado.
210
+ fund_name: Nome do fundo conforme BTG. String vazia retorna as movimentacoes para todos os fundos.
211
+ date_type: Enum da API (`LIQUIDACAO`, `MOVIMENTO`, etc.).
212
+ page_size: Página retornada por chamada (default 100).
213
+
214
+ Returns
215
+ -------
216
+ str
217
+ ID do ticket a ser acompanhado em :pyfunc:`await_fundflow_ticket_result`.
218
+ """
219
+
220
+ body = {
221
+ "contract": {
222
+ "startDate": f"{start_date}T00:00:00Z",
223
+ "endDate": f"{end_date}T00:00:00Z",
224
+ "dateType": date_type,
225
+ "fundName": fund_name,
226
+ },
227
+ "pageSize": page_size,
228
+ "webhookEndpoint": "string",
229
+ }
230
+
231
+ r = requests.post(
232
+ _FUNDFLOW_ENDPOINT,
233
+ headers={"X-SecureConnect-Token": token, "Content-Type": "application/json"},
234
+ json=body,
235
+ timeout=30,
236
+ )
237
+ if r.ok:
238
+ return r.json()["ticket"]
239
+ raise BTGApiError(f"Erro FundFlow: {r.status_code} - {r.text}")
@@ -18,10 +18,17 @@ def save_table(
18
18
  *,
19
19
  index: bool = False,
20
20
  index_name: str = "index",
21
- normalize_columns: bool = False,
21
+ normalize_columns: bool = True,
22
22
  directory: str = "enriched/parquet",
23
+ override=False
23
24
  ):
24
25
  """Salva DataFrame como Parquet em ADLS (sobrescrevendo)."""
26
+
27
+ if override == False:
28
+ lq = LuxorQuery()
29
+ if lq.table_exists(table_name):
30
+ return
31
+
25
32
  df = prep_for_save(df, index=index, index_name=index_name, normalize=normalize_columns)
26
33
  _client.write_df(df.astype(str), f"{directory}/{table_name}.parquet")
27
34
 
@@ -34,7 +41,7 @@ def incremental_load(
34
41
  increment_column: str = "Date",
35
42
  index: bool = False,
36
43
  index_name: str = "index",
37
- normalize_columns: bool = False,
44
+ normalize_columns: bool = True,
38
45
  directory: str = "enriched/parquet",
39
46
  ):
40
47
  """Concatena novos dados aos existentes, cortando duplicados pela data."""
@@ -0,0 +1,241 @@
1
+ Metadata-Version: 2.4
2
+ Name: luxorasap
3
+ Version: 0.1.3
4
+ Summary: Luxor’s unified toolbox for data ingestion, querying and analytics.
5
+ Author-email: Luxor Group <backoffice@luxor.com.br>
6
+ License: Proprietary – All rights reserved
7
+ Classifier: Programming Language :: Python :: 3
8
+ Classifier: License :: Other/Proprietary License
9
+ Classifier: Operating System :: OS Independent
10
+ Requires-Python: >=3.9
11
+ Description-Content-Type: text/markdown
12
+ Requires-Dist: pandas>=2.2
13
+ Requires-Dist: numpy>=1.25
14
+ Requires-Dist: loguru>=0.7
15
+ Requires-Dist: python-dotenv>=1.0
16
+ Requires-Dist: azure-storage-blob>=12.19
17
+ Requires-Dist: pyarrow>=15.0
18
+ Requires-Dist: requests>=2.32
19
+ Requires-Dist: pydantic>=2.7
20
+ Requires-Dist: scipy>=1.13
21
+ Requires-Dist: openpyxl
22
+ Provides-Extra: storage
23
+ Requires-Dist: azure-storage-blob>=12.19; extra == "storage"
24
+ Requires-Dist: pyarrow>=15.0; extra == "storage"
25
+ Provides-Extra: dataframe
26
+ Requires-Dist: pandas>=2.2; extra == "dataframe"
27
+ Provides-Extra: datareader
28
+ Requires-Dist: luxorasap[dataframe,storage]; extra == "datareader"
29
+ Requires-Dist: numpy>=1.25; extra == "datareader"
30
+ Requires-Dist: scipy>=1.13; extra == "datareader"
31
+ Provides-Extra: ingest
32
+ Requires-Dist: luxorasap[dataframe,storage]; extra == "ingest"
33
+ Requires-Dist: pandas>=2.2; extra == "ingest"
34
+ Provides-Extra: btgapi
35
+ Requires-Dist: requests>=2.32; extra == "btgapi"
36
+ Requires-Dist: pydantic>=2.7; extra == "btgapi"
37
+ Provides-Extra: dev
38
+ Requires-Dist: pytest>=8.2; extra == "dev"
39
+ Requires-Dist: requests-mock>=1.11; extra == "dev"
40
+ Requires-Dist: black>=24.4.0; extra == "dev"
41
+ Requires-Dist: isort>=5.13; extra == "dev"
42
+ Requires-Dist: bumpver>=2024.3; extra == "dev"
43
+ Requires-Dist: pre-commit>=3.7; extra == "dev"
44
+ Requires-Dist: build>=1.2; extra == "dev"
45
+
46
+ # 📚 Documentação LuxorASAP
47
+
48
+ > Guia do desenvolvedor para os subpacotes **datareader**, **ingest**, **btgapi** e **utils**.
49
+ >
50
+ > • Instalação rápida • Visão arquitetural • APIs detalhadas • Exemplos de uso • Extras opcional
51
+
52
+ ---
53
+
54
+ ## Índice
55
+
56
+ 1. [Visão Geral](#visao-geral)
57
+ 2. [Instalação](#instalacao)
58
+ 3. [utils](#utils)
59
+ 4. [datareader](#datareader)
60
+ 5. [ingest](#ingest)
61
+ 6. [btgapi](#btgapi)
62
+ 7. [Roadmap & Contribuições](#roadmap)
63
+
64
+ ---
65
+
66
+ ## 1. Visão Geral
67
+
68
+ LuxorASAP é o *toolbox* unificado da Luxor para ingestão, consulta e automação de dados financeiros.
69
+
70
+ | Subpacote | Função‑chave | Extras PyPI |
71
+ | -------------- | --------------------------------------------------------------------- | ---------------------- |
72
+ | **utils** | Utilidades puras (I/O ADLS, transformação de DataFrame, decorators) | `storage`, `dataframe` |
73
+ | **datareader** | Consulta de preços/tabelas no data lake via `LuxorQuery` | `datareader` |
74
+ | **ingest** | Carga de dados nova (parquet/zip/excel) em ADLS + loader legado | `ingest` |
75
+ | **btgapi** | Wrapper autenticado para as APIs do BTG Pactual (relatórios & trades) | `btgapi` |
76
+
77
+ ---
78
+
79
+ ## 2. Instalação
80
+
81
+ ```bash
82
+ # core + leitura de dados
83
+ pip install luxorasap[datareader]
84
+
85
+ # tudo incluído (leitura, ingest, btg)
86
+ pip install luxorasap[datareader,ingest,btgapi]
87
+
88
+ # desenvolvimento
89
+ pip install -e ".[dev]"
90
+ ```
91
+
92
+ Extras podem ser combinados à vontade (`luxorasap[storage]`, etc.).
93
+
94
+ Configuração obrigatória do **ADLS**:
95
+
96
+ ```bash
97
+ export AZURE_STORAGE_CONNECTION_STRING="DefaultEndpointsProtocol=..."
98
+ ```
99
+
100
+ ---
101
+
102
+ ## 3. utils
103
+
104
+ Camada de utilidades **sem dependências internas**.
105
+
106
+ ### 3.1 storage.BlobParquetClient
107
+
108
+ ```python
109
+ from luxorasap.utils.storage import BlobParquetClient
110
+ client = BlobParquetClient(container="luxorasap")
111
+
112
+ # write
113
+ client.write_df(df, "bronze/parquet/mytable.parquet")
114
+
115
+ # read (tuple -> DataFrame, success_flag)
116
+ df, ok = client.read_df("bronze/parquet/mytable.parquet")
117
+ ```
118
+
119
+ ### 3.2 dataframe
120
+
121
+ ```python
122
+ from luxorasap.utils.dataframe import prep_for_save, persist_column_formatting, read_bytes
123
+
124
+ df2 = prep_for_save(df, index=True, index_name="ID", normalize=True)
125
+ ```
126
+
127
+ ### 3.3 decorators & misc
128
+
129
+ `with_retry`, `chunkify`, `timer`… ficam em *utils.helpers* (caso precise).
130
+
131
+ ---
132
+
133
+ ## 4. datareader
134
+
135
+ ### 4.1 Visão rápida
136
+
137
+ ```python
138
+ from luxorasap.datareader import LuxorQuery
139
+ lq = LuxorQuery()
140
+
141
+ # DataFrame completo
142
+ df = lq.get_table("assets")
143
+
144
+ # Série de preços diária
145
+ aapl = lq.get_prices("aapl us equity", start="2025-01-01", end="2025-03-31")
146
+
147
+ # Preço pontual
148
+ price = lq.get_price("aapl us equity", on="2025-03-31")
149
+ ```
150
+
151
+ *Caching*: `@lru_cache(maxsize=32)` evita hits repetidos ao Blob.
152
+
153
+ ### 4.2 Métodos-chave
154
+
155
+ | Método | Descrição |
156
+ | ----------------------------------------------- | ----------------------------- |
157
+ | `table_exists(name)` | checa metadados no ADLS |
158
+ | `get_table(name)` | DataFrame completo (cached) |
159
+ | `get_prices(asset, start, end, column="Price")` | `pd.Series` |
160
+ | `get_price(asset, on)` | preço pontual (float ou None) |
161
+
162
+ ---
163
+
164
+ ## 5. ingest
165
+
166
+ ### 5.1 ingest.cloud (novo)
167
+
168
+ ```python
169
+ from luxorasap.ingest import save_table, incremental_load
170
+ from luxorasap.datareader import LuxorQuery
171
+
172
+ save_table("trades", df)
173
+
174
+ lq = LuxorQuery()
175
+ incremental_load(lq, "prices_daily", df_new, increment_column="Date")
176
+ ```
177
+
178
+ ### 5.2 ingest.legacy\_local
179
+
180
+ ```python
181
+ from luxorasap.ingest import DataLoader # Deprecado – ainda funcional
182
+ ```
183
+
184
+ *Decoration*: ao importar `DataLoader` você verá `DeprecationWarning`.
185
+
186
+ ---
187
+
188
+ ## 6. btgapi
189
+
190
+ ### 6.1 Autenticação
191
+
192
+ ```python
193
+ from luxorasap.btgapi import get_access_token
194
+ TOKEN = get_access_token(test_env=True)
195
+ ```
196
+
197
+ ### 6.2 Relatórios – Portfolio & Investor Transactions
198
+
199
+ ```python
200
+ from luxorasap.btgapi.reports import (
201
+ request_portfolio, await_report_ticket_result, process_zip_to_dfs,
202
+ request_investors_transactions_report,
203
+ )
204
+
205
+ ticket = request_portfolio(TOKEN, "LUXOR FUND - CLASS A",
206
+ start=dt.date(2025,1,1), end=dt.date(2025,1,31))
207
+ zip_bytes = await_report_ticket_result(TOKEN, ticket)
208
+ carteiras = process_zip_to_dfs(zip_bytes)
209
+ ```
210
+
211
+ ### 6.3 Trades offshore
212
+
213
+ ```python
214
+ from luxorasap.btgapi.trades import (
215
+ submit_offshore_equity_trades,
216
+ await_transaction_ticket_result,
217
+ )
218
+
219
+ ticket = submit_offshore_equity_trades(TOKEN, trades=[{...}], test_env=True)
220
+ status_df = await_transaction_ticket_result(TOKEN, ticket, test_env=True)
221
+ ```
222
+
223
+ ### 6.4 Extras
224
+
225
+ * `BTGApiError` — exceção customizada para qualquer falha.
226
+
227
+ ---
228
+
229
+ ## 7. Roadmap & Contribuições
230
+
231
+ * **Remover** `ingest.legacy_local` quando não houver mais dependências.
232
+ * Suporte a partições Parquet (delta‑like) na gravação.
233
+ * Adicionar `pydantic` para validar contratos BTG.
234
+ * Pull requests bem‑vindos! Rode `make lint && pytest -q` antes de enviar.
235
+
236
+ ---
237
+
238
+ ### Contatos
239
+
240
+ * Dados / Back‑Office – [backoffice@luxor.com.br](mailto:backoffice@luxor.com.br)
241
+ * Mantenedor principal – Sergio
@@ -1,12 +1,12 @@
1
- luxorasap/__init__.py,sha256=nXxCeYO_7SQzrZ_jTanpDSplTLqWOGIFXTIWKy5xyKI,1355
2
- luxorasap/btgapi/__init__.py,sha256=DISzvHp-J7oeNq_PhmCt-_ZRBCaUgkQ9k2wtJLm-kgs,563
3
- luxorasap/btgapi/auth.py,sha256=UEihM5OXHhtHdB9NiAMlmEUDR_H3cqg305CdFxATrYY,1846
4
- luxorasap/btgapi/reports.py,sha256=bn54MiYzdrm2SMXx6nqdy5nd6Pd2uBQk2cYaEFFiaMY,6145
1
+ luxorasap/__init__.py,sha256=Zv3_ZOZLgZtlPZbbKiM743UmDx6FN7-iHv4U5qUlro4,1355
2
+ luxorasap/btgapi/__init__.py,sha256=QUlfb5oiBY6K1Q5x4-a-x2wECe1At5wc2962I5odOJk,620
3
+ luxorasap/btgapi/auth.py,sha256=2TLKZdVlJgfSItOvB7GoPnH6gndkWWqSIyE4VDSYRgo,1873
4
+ luxorasap/btgapi/reports.py,sha256=UEk5QAl4cS6vdxXyliyg-weT0C1mILE1bqilPRDuHPE,7975
5
5
  luxorasap/btgapi/trades.py,sha256=1Cn1RMjaHO073YHJFeN2XRxYElQH7A98GIfUVy0VmSg,5987
6
6
  luxorasap/datareader/__init__.py,sha256=41RAvbrQ4R6oj67S32CrKqolx0CJ2W8cbOF6g5Cqm2g,120
7
7
  luxorasap/datareader/core.py,sha256=LpXe5g4lZpfEqaz_gjjHizVA-vPEjBi5yJKg_7K0Nkw,153205
8
8
  luxorasap/ingest/__init__.py,sha256=XhxDTN2ar-u6UCPhnxNU_to-nWiit-SpQ6cA_N9eMSs,795
9
- luxorasap/ingest/cloud/__init__.py,sha256=V8cCNloP1RgPTEPsepHvWVL4m_t5geQuBORLm7x-OKQ,1729
9
+ luxorasap/ingest/cloud/__init__.py,sha256=lbb3GweA8m0mQuH64HCKwO5FLwih4orU7i9KNhWWAkk,1867
10
10
  luxorasap/ingest/legacy_local/dataloader.py,sha256=zKPhuiBSFwkuWN6d8g2s60KkbVk1R_1cGMCtQM9j-0c,11908
11
11
  luxorasap/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
12
12
  luxorasap/utils/dataframe/__init__.py,sha256=dU_RwTTOi6F3mlhM-0MYWM_qexBN9BmmKc_yrDE1Lwc,207
@@ -14,8 +14,8 @@ luxorasap/utils/dataframe/reader.py,sha256=Vzjdw-AeS1lnWEHQ8RZNh0kK93NWTp0NWVi_B
14
14
  luxorasap/utils/dataframe/transforms.py,sha256=Bm_cv9L9923QIXH82Fa_M4pM94f2AJRPu62Vv_i7tto,1684
15
15
  luxorasap/utils/storage/__init__.py,sha256=U3XRq94yzRp3kgBSUcRzs2tQgJ4o8h8a1ZzwiscA5XM,67
16
16
  luxorasap/utils/storage/blob.py,sha256=pcEixGxwXM9y5iPPpkX__ySWq0milghJGketYZlRL-0,3171
17
- luxorasap-0.1.1.dist-info/METADATA,sha256=m7ksGU4yvcq3T62mSpMa8IcDA5jrPAiRTDcRTJaVGfA,3093
18
- luxorasap-0.1.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
19
- luxorasap-0.1.1.dist-info/entry_points.txt,sha256=XFh-dOwUhlya9DmGvgookMI0ezyUJjcOvTIHDEYS44g,52
20
- luxorasap-0.1.1.dist-info/top_level.txt,sha256=9YOL6bUIpzY06XFBRkUW1e4rgB32Ds91fQPGwUEjxzU,10
21
- luxorasap-0.1.1.dist-info/RECORD,,
17
+ luxorasap-0.1.3.dist-info/METADATA,sha256=gom3LK0bhLeQS83_rCGv7xfmw6MnoFPzh46tL5jNqwg,6994
18
+ luxorasap-0.1.3.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
19
+ luxorasap-0.1.3.dist-info/entry_points.txt,sha256=XFh-dOwUhlya9DmGvgookMI0ezyUJjcOvTIHDEYS44g,52
20
+ luxorasap-0.1.3.dist-info/top_level.txt,sha256=9YOL6bUIpzY06XFBRkUW1e4rgB32Ds91fQPGwUEjxzU,10
21
+ luxorasap-0.1.3.dist-info/RECORD,,
@@ -1,80 +0,0 @@
1
- Metadata-Version: 2.4
2
- Name: luxorasap
3
- Version: 0.1.1
4
- Summary: Luxor’s unified toolbox for data ingestion, querying and analytics.
5
- Author-email: Luxor Group <backoffice@luxor.com.br>
6
- License: Proprietary – All rights reserved
7
- Classifier: Programming Language :: Python :: 3
8
- Classifier: License :: Other/Proprietary License
9
- Classifier: Operating System :: OS Independent
10
- Requires-Python: >=3.9
11
- Description-Content-Type: text/markdown
12
- Requires-Dist: pandas>=2.2
13
- Requires-Dist: numpy>=1.25
14
- Requires-Dist: loguru>=0.7
15
- Requires-Dist: python-dotenv>=1.0
16
- Requires-Dist: azure-storage-blob>=12.19
17
- Requires-Dist: pyarrow>=15.0
18
- Requires-Dist: requests>=2.32
19
- Requires-Dist: pydantic>=2.7
20
- Requires-Dist: scipy>=1.13
21
- Requires-Dist: openpyxl
22
- Provides-Extra: storage
23
- Requires-Dist: azure-storage-blob>=12.19; extra == "storage"
24
- Requires-Dist: pyarrow>=15.0; extra == "storage"
25
- Provides-Extra: dataframe
26
- Requires-Dist: pandas>=2.2; extra == "dataframe"
27
- Provides-Extra: datareader
28
- Requires-Dist: luxorasap[dataframe,storage]; extra == "datareader"
29
- Requires-Dist: numpy>=1.25; extra == "datareader"
30
- Requires-Dist: scipy>=1.13; extra == "datareader"
31
- Provides-Extra: ingest
32
- Requires-Dist: luxorasap[dataframe,storage]; extra == "ingest"
33
- Requires-Dist: pandas>=2.2; extra == "ingest"
34
- Provides-Extra: btgapi
35
- Requires-Dist: requests>=2.32; extra == "btgapi"
36
- Requires-Dist: pydantic>=2.7; extra == "btgapi"
37
- Provides-Extra: dev
38
- Requires-Dist: pytest>=8.2; extra == "dev"
39
- Requires-Dist: requests-mock>=1.11; extra == "dev"
40
- Requires-Dist: black>=24.4.0; extra == "dev"
41
- Requires-Dist: isort>=5.13; extra == "dev"
42
- Requires-Dist: bumpver>=2024.3; extra == "dev"
43
- Requires-Dist: pre-commit>=3.7; extra == "dev"
44
- Requires-Dist: build>=1.2; extra == "dev"
45
-
46
- # LuxorASAP
47
-
48
- **LuxorASAP** é o pacote-guarda-chuva que concentra as ferramentas internas de dados da Luxor Group:
49
- consulta estruturada ao data lake, cargas padronizadas para ADLS, wrappers de API, utilitários e muito mais.
50
-
51
- [![PyPI](https://img.shields.io/pypi/v/luxorasap.svg)](https://pypi.org/project/luxorasap/)
52
- ![Python](https://img.shields.io/pypi/pyversions/luxorasap)
53
-
54
- ---
55
-
56
- ## Instalação
57
-
58
- ```bash
59
- # pacote base
60
- pip install luxorasap
61
-
62
- # com o submódulo datareader
63
- pip install "luxorasap[datareader]"
64
- ```
65
- ## Uso rápido
66
- ```python
67
- from luxorasap.datareader import LuxorQuery
68
-
69
- lq = LuxorQuery(blob_directory="enriched/parquet")
70
- prices = lq.get_prices("aapl us equity", "2024-01-01", "2024-12-31")
71
- print(prices.head())
72
- ```
73
- ## Submódulos
74
- | Módulo | Descrição rápida | Extras |
75
- | ---------------------- | ---------------------------------------- | ------------------------------------- |
76
- | `luxorasap.datareader` | Leitura de tabelas e séries no data lake | `pip install "luxorasap[datareader]"` |
77
- | `luxorasap.ingest` | Funções de carga padronizada para ADLS | `"luxorasap[ingest]"` |
78
- | `luxorasap.btgapi` | Wrapper REST para dados BTG | `"luxorasap[btgapi]"` |
79
-
80
- © Luxor Group – uso interno. Todos os direitos reservados.