luxorasap 0.2.3__py3-none-any.whl → 0.2.5__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 +13 -3
- {luxorasap-0.2.3.dist-info → luxorasap-0.2.5.dist-info}/METADATA +1 -1
- {luxorasap-0.2.3.dist-info → luxorasap-0.2.5.dist-info}/RECORD +7 -7
- {luxorasap-0.2.3.dist-info → luxorasap-0.2.5.dist-info}/WHEEL +0 -0
- {luxorasap-0.2.3.dist-info → luxorasap-0.2.5.dist-info}/entry_points.txt +0 -0
- {luxorasap-0.2.3.dist-info → luxorasap-0.2.5.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.5"
|
|
17
17
|
|
|
18
18
|
# ─── Lazy loader ─────────────────────────────────────────────────
|
|
19
19
|
def __getattr__(name: str) -> ModuleType:
|
luxorasap/datareader/core.py
CHANGED
|
@@ -107,7 +107,7 @@ class LuxorQuery:
|
|
|
107
107
|
return tables
|
|
108
108
|
|
|
109
109
|
|
|
110
|
-
def get_table(self, table_name, index=False, index_name="index", dtypes_override={}, force_reload=False):
|
|
110
|
+
def get_table(self, table_name, index=False, index_name="index", dtypes_override={}, force_reload=False, drop_last_updated_columns=True):
|
|
111
111
|
"""
|
|
112
112
|
Retorna uma copia do DataFrame do 'table_name' correspondente. Se não estiver disponivel,
|
|
113
113
|
retorna None.
|
|
@@ -142,7 +142,14 @@ class LuxorQuery:
|
|
|
142
142
|
if (table_name in self.tables_in_use) and not force_reload:
|
|
143
143
|
return self.tables_in_use[table_name]["table_data"]
|
|
144
144
|
|
|
145
|
-
|
|
145
|
+
|
|
146
|
+
table_data = self.__load_table(table_name, index=index, index_name=index_name, dtypes_override=dtypes_override)
|
|
147
|
+
|
|
148
|
+
if drop_last_updated_columns:
|
|
149
|
+
if "Last_Updated" in table_data.columns:
|
|
150
|
+
return table_data.drop(columns=["Last_Updated"])
|
|
151
|
+
|
|
152
|
+
return table_data
|
|
146
153
|
|
|
147
154
|
|
|
148
155
|
|
|
@@ -546,6 +553,9 @@ class LuxorQuery:
|
|
|
546
553
|
px_last = self.get_table("px_last", index=True, index_name="Key").copy()
|
|
547
554
|
# Selecionando todos os tickers que estao na tabela px_last
|
|
548
555
|
px_last = px_last.query("Key in @tickers").reset_index()
|
|
556
|
+
if ("Last_Updated" in px_last.columns) and ("Last_Updated" in hist_prices.columns):
|
|
557
|
+
px_last = px_last.drop(columns=["Last_Updated"])
|
|
558
|
+
|
|
549
559
|
# Vamos alterar a ultima ocorrencia desses tickers na hist_prices pelos valores na px_last
|
|
550
560
|
# vamos fazer de forma vetorizada]
|
|
551
561
|
hist_prices_columns = list(hist_prices.columns)
|
|
@@ -1210,7 +1220,7 @@ class LuxorQuery:
|
|
|
1210
1220
|
).set_index("Date")
|
|
1211
1221
|
if pct_changes.empty:
|
|
1212
1222
|
return pd.DataFrame(columns=["Asset", "Pct_Change"]).set_index("Asset")
|
|
1213
|
-
|
|
1223
|
+
print(pct_changes)
|
|
1214
1224
|
pct_changes["Pct_Change"] = pct_changes.groupby("Asset").pct_change().fillna(0)+1
|
|
1215
1225
|
pct_changes = pct_changes[["Asset", "Pct_Change"]]
|
|
1216
1226
|
pct_changes["Pct_Change"] = pct_changes.groupby("Asset").cumprod()-1
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
luxorasap/__init__.py,sha256
|
|
1
|
+
luxorasap/__init__.py,sha256=tIrJupf7Fli_VdiCZf01rJyGbfpy5xha2aXqN0yX-zY,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
|
|
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=m6lW9LfQvwa5KK53Qo-6FvKoL-AmjifllMP3Jz8pt4A,157789
|
|
8
8
|
luxorasap/ingest/__init__.py,sha256=XhxDTN2ar-u6UCPhnxNU_to-nWiit-SpQ6cA_N9eMSs,795
|
|
9
9
|
luxorasap/ingest/cloud/__init__.py,sha256=HRKLjxqa-COssAPoFrjfOlE_dkvTDcv5tyDhmqcdYOI,3690
|
|
10
10
|
luxorasap/ingest/legacy_local/dataloader.py,sha256=DF3CvojDAi0itVDZPsQbmpl5pqMTNwOOpxTz4Ju8mho,12419
|
|
@@ -17,8 +17,8 @@ luxorasap/utils/storage/blob.py,sha256=vgCKMOiVgP-V1A2xZRhG3kJhPFU-LA9E9kddOQTxY
|
|
|
17
17
|
luxorasap/utils/storage/change_tracker.py,sha256=5URYI18mymcVfUyyb9zi8NeNDVrdYgdOAs8L58GwL5Q,11706
|
|
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.5.dist-info/METADATA,sha256=2DnVfUHqiGI8Q-j3BhedTy0OpGp6b19tAG7okMHRTbM,3803
|
|
21
|
+
luxorasap-0.2.5.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
22
|
+
luxorasap-0.2.5.dist-info/entry_points.txt,sha256=XFh-dOwUhlya9DmGvgookMI0ezyUJjcOvTIHDEYS44g,52
|
|
23
|
+
luxorasap-0.2.5.dist-info/top_level.txt,sha256=9YOL6bUIpzY06XFBRkUW1e4rgB32Ds91fQPGwUEjxzU,10
|
|
24
|
+
luxorasap-0.2.5.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|