luxorasap 0.1.13__py3-none-any.whl → 0.1.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.1.13"
16
+ __version__ = "0.1.15"
17
17
 
18
18
  # ─── Lazy loader ─────────────────────────────────────────────────
19
19
  def __getattr__(name: str) -> ModuleType:
@@ -297,9 +297,10 @@ class LuxorQuery:
297
297
  last_date_df["Last_Price"] = last_prices.values
298
298
 
299
299
  table = (pd.concat([table, last_date_df]).sort_values(by="Date")
300
- .set_index("Date").groupby("Asset")
301
- .apply(lambda g: g[~g.index.duplicated(keep="first")].resample("D").ffill()).reset_index(level=0, drop=True)
302
- .reset_index())
300
+ .set_index("Date").groupby("Asset")
301
+ .apply(lambda g: g[~g.index.duplicated(keep="first")].resample("D").ffill(),
302
+ include_groups=False).reset_index(level=0, drop=True)
303
+ .reset_index())
303
304
 
304
305
  self.price_tables_loaded[table_key] = table
305
306
 
@@ -648,6 +649,12 @@ class LuxorQuery:
648
649
  prices = prices.set_index("Date").groupby("Asset")\
649
650
  .resample("D").last().ffill()\
650
651
  .reset_index(level=0, drop=True).reset_index()
652
+ # Precisará ser substituido pela linha abaixo no futuro
653
+ # Porém ha perda de eficiencia, avaliar outras opções.
654
+ #prices = prices.set_index("Date").groupby("Asset", group_keys=False)\
655
+ # .apply(lambda g: g.resample("D").last().ffill().assign(Asset=g.name),
656
+ # include_groups=False).reset_index()
657
+
651
658
 
652
659
  if get_intraday_prices:
653
660
  prices = self.__hist_prices_intraday_extensor(prices)
@@ -1831,7 +1838,10 @@ class LuxorQuery:
1831
1838
  # cash estara com ambos os caixas em R$ ou U$.
1832
1839
  # Para saber a moeda do caixa retornado, precisamos saber a moeda do fundo
1833
1840
  fund_key = fund.replace('_', ' ')
1834
- fund_location = self.get_table("funds").query("Short_Name == @fund_key")["Country"].squeeze()
1841
+ fund = self.get_table("funds")
1842
+ fund['Country'] = fund['Country'].replace('br', 'bz')
1843
+ fund_location = fund.query("Short_Name == @fund_key")["Country"].squeeze()
1844
+
1835
1845
  currency_location = "us" if currency == "usd" else "bz"
1836
1846
  if fund_location != currency_location:
1837
1847
  usdbrl = self.get_prices(usdbrl_ticker, previous_date=cash["Date"].min(), recent_date=cash["Date"].max(),)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: luxorasap
3
- Version: 0.1.13
3
+ Version: 0.1.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,10 +1,10 @@
1
- luxorasap/__init__.py,sha256=JyrkwJHzpzhAwKfAamtAeRTt5FDdAapSjRnw2fIa4tg,1356
1
+ luxorasap/__init__.py,sha256=lHZk7izy83rJh7Ij2oSrUOFc4wecgAttn7OMbkT94AA,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=4Ruxz9pCDgfLIdkmQ8-nt239VKAsR_El7o9YBIOGtc0,154657
7
+ luxorasap/datareader/core.py,sha256=P8AjtRFRRmUrqjbjfKRb0wTLW2eHcUva8iWid4uh4PE,155123
8
8
  luxorasap/ingest/__init__.py,sha256=XhxDTN2ar-u6UCPhnxNU_to-nWiit-SpQ6cA_N9eMSs,795
9
9
  luxorasap/ingest/cloud/__init__.py,sha256=Hm-43YkjRhu3UiFVt1Zx7DmQuNJnK2GVWfCx1T3gKNc,2052
10
10
  luxorasap/ingest/legacy_local/dataloader.py,sha256=zKPhuiBSFwkuWN6d8g2s60KkbVk1R_1cGMCtQM9j-0c,11908
@@ -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.13.dist-info/METADATA,sha256=KPnVO3-pYQVk-rockpAPUoq8XlcGnLMHwapIDFXkm9A,3804
18
- luxorasap-0.1.13.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
19
- luxorasap-0.1.13.dist-info/entry_points.txt,sha256=XFh-dOwUhlya9DmGvgookMI0ezyUJjcOvTIHDEYS44g,52
20
- luxorasap-0.1.13.dist-info/top_level.txt,sha256=9YOL6bUIpzY06XFBRkUW1e4rgB32Ds91fQPGwUEjxzU,10
21
- luxorasap-0.1.13.dist-info/RECORD,,
17
+ luxorasap-0.1.15.dist-info/METADATA,sha256=klkzeKwjA2gyPqPqxeI2QqlBMgqYSbiYS2cDTOtN2gM,3804
18
+ luxorasap-0.1.15.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
19
+ luxorasap-0.1.15.dist-info/entry_points.txt,sha256=XFh-dOwUhlya9DmGvgookMI0ezyUJjcOvTIHDEYS44g,52
20
+ luxorasap-0.1.15.dist-info/top_level.txt,sha256=9YOL6bUIpzY06XFBRkUW1e4rgB32Ds91fQPGwUEjxzU,10
21
+ luxorasap-0.1.15.dist-info/RECORD,,