luxorasap 0.2.16__py3-none-any.whl → 0.2.18__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 +1 -1
- luxorasap/datareader/core.py +18 -10
- luxorasap/ingest/cloud/__init__.py +1 -3
- {luxorasap-0.2.16.dist-info → luxorasap-0.2.18.dist-info}/METADATA +1 -1
- {luxorasap-0.2.16.dist-info → luxorasap-0.2.18.dist-info}/RECORD +8 -8
- {luxorasap-0.2.16.dist-info → luxorasap-0.2.18.dist-info}/WHEEL +0 -0
- {luxorasap-0.2.16.dist-info → luxorasap-0.2.18.dist-info}/entry_points.txt +0 -0
- {luxorasap-0.2.16.dist-info → luxorasap-0.2.18.dist-info}/top_level.txt +0 -0
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.
|
|
16
|
+
__version__ = "0.2.18"
|
|
17
17
|
|
|
18
18
|
# ─── Lazy loader ─────────────────────────────────────────────────
|
|
19
19
|
def __getattr__(name: str) -> ModuleType:
|
luxorasap/datareader/core.py
CHANGED
|
@@ -235,7 +235,7 @@ class LuxorQuery:
|
|
|
235
235
|
raise ValueError(f"Erro ao converter coluna {col} para bool na tabela '{table_name}'.")
|
|
236
236
|
|
|
237
237
|
for col in table_columns.intersection(str_nan_format):
|
|
238
|
-
table_data[col] = table_data[col].replace("nan", pd.NA).replace("", pd.NA)
|
|
238
|
+
table_data[col] = table_data[col].replace("<NA>", pd.NA).replace("nan", pd.NA).replace("", pd.NA)
|
|
239
239
|
|
|
240
240
|
|
|
241
241
|
|
|
@@ -797,7 +797,7 @@ class LuxorQuery:
|
|
|
797
797
|
|
|
798
798
|
|
|
799
799
|
def get_data(self, ticker, flds, data_date=None, logger_level="trace"):
|
|
800
|
-
|
|
800
|
+
|
|
801
801
|
flds = flds.lower().replace(" ","_")
|
|
802
802
|
|
|
803
803
|
if flds == "px_last":
|
|
@@ -842,16 +842,23 @@ class LuxorQuery:
|
|
|
842
842
|
|
|
843
843
|
# Buscamos por dado numa data especifica.
|
|
844
844
|
hist_all_flds = self.get_table("hist_all_flds")
|
|
845
|
-
|
|
845
|
+
data_value = None
|
|
846
846
|
try:
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
if len(data) > 0:
|
|
850
|
-
return data.tail(1).squeeze()
|
|
847
|
+
data_value = hist_all_flds.query("Date <= @data_date and Field == @flds and Ticker == @ticker")["Value"]
|
|
848
|
+
data_value = data_value.tail(1).squeeze()
|
|
851
849
|
except KeyError:
|
|
852
850
|
logging.info(f"Dado de {flds} nao disponivel para o ticker '{ticker}'.")
|
|
853
|
-
|
|
854
|
-
|
|
851
|
+
|
|
852
|
+
# Verificando o formato
|
|
853
|
+
data_type = self.get_table("field_map").query("Field == @flds")["Value_Type"].squeeze()
|
|
854
|
+
|
|
855
|
+
if data_type == 'numerical':
|
|
856
|
+
return float(data_value)
|
|
857
|
+
if data_type == "date":
|
|
858
|
+
return dt.datetime.fromtimestamp(float(data_value))
|
|
859
|
+
if data_type != "text":
|
|
860
|
+
logging.info(f"field '{flds}' nao foi cadastrado na tabela field_map.")
|
|
861
|
+
return data_value
|
|
855
862
|
|
|
856
863
|
|
|
857
864
|
def get_bdr_size(self, ticker):
|
|
@@ -1155,7 +1162,8 @@ class LuxorQuery:
|
|
|
1155
1162
|
return df[["Date", "Benchmark"]].set_index("Date")
|
|
1156
1163
|
|
|
1157
1164
|
def get_quota_adjusted_by_amortization(self, fund_name, quota, date):
|
|
1158
|
-
|
|
1165
|
+
""" Obtem cota ajudata pela amortização. Sendo usando para ajustar as cotas do Maratona
|
|
1166
|
+
"""
|
|
1159
1167
|
amortizations = { # Amortizacao Bruta / PL antes da amortizacao
|
|
1160
1168
|
"maratona" : [{"event_date" : dt.date(2024,1,4), "amortization_ratio" : 2_517_404.21/24_165_260.40},
|
|
1161
1169
|
{"event_date" : dt.date(2025,1,8), "amortization_ratio" : 950_000/27_633_373.46},
|
|
@@ -76,9 +76,7 @@ def save_table(
|
|
|
76
76
|
_client_excel.write_excel_multiple_sheets(df, f"{directory}/{table_name}.xlsx")
|
|
77
77
|
|
|
78
78
|
elif format == 'pickle':
|
|
79
|
-
|
|
80
|
-
if _client_pickle is None:
|
|
81
|
-
_client_pickle = BlobPickleClient()
|
|
79
|
+
_client_pickle = BlobPickleClient()
|
|
82
80
|
_client_pickle.write_pickle(df, f"{directory}/{table_name}.pkl")
|
|
83
81
|
|
|
84
82
|
else:
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
luxorasap/__init__.py,sha256=
|
|
1
|
+
luxorasap/__init__.py,sha256=8MjqkakzDZjvC7c6NKFQOZBG2WKgk9_y1Nn5s7--HXA,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
|
|
5
5
|
luxorasap/btgapi/trades.py,sha256=956HZ9BvN9C_VQvKTyBLN0x6ZygwVqBZN11F7OnNbDI,5985
|
|
6
6
|
luxorasap/datareader/__init__.py,sha256=41RAvbrQ4R6oj67S32CrKqolx0CJ2W8cbOF6g5Cqm2g,120
|
|
7
|
-
luxorasap/datareader/core.py,sha256=
|
|
7
|
+
luxorasap/datareader/core.py,sha256=5RpOoam9ZS1GShKIE4ekMYsFpX4-Hla2dKoS63IH41o,159309
|
|
8
8
|
luxorasap/ingest/__init__.py,sha256=gHkw8FU8TuRL5tfHkACxwsLHwLYX8SgX9xHkB8uTjww,831
|
|
9
|
-
luxorasap/ingest/cloud/__init__.py,sha256=
|
|
9
|
+
luxorasap/ingest/cloud/__init__.py,sha256=JYhrE6LG9mRTMdOreN9lfaLUNxqdB5S2vvM9dH1J4ak,8171
|
|
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.
|
|
21
|
-
luxorasap-0.2.
|
|
22
|
-
luxorasap-0.2.
|
|
23
|
-
luxorasap-0.2.
|
|
24
|
-
luxorasap-0.2.
|
|
20
|
+
luxorasap-0.2.18.dist-info/METADATA,sha256=Wt1e3cuXu6Nibq_sZsF-Cl6yQqtZGSZvmYSYnt4slt8,3804
|
|
21
|
+
luxorasap-0.2.18.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
22
|
+
luxorasap-0.2.18.dist-info/entry_points.txt,sha256=XFh-dOwUhlya9DmGvgookMI0ezyUJjcOvTIHDEYS44g,52
|
|
23
|
+
luxorasap-0.2.18.dist-info/top_level.txt,sha256=9YOL6bUIpzY06XFBRkUW1e4rgB32Ds91fQPGwUEjxzU,10
|
|
24
|
+
luxorasap-0.2.18.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|