PYield 0.35.3__tar.gz → 0.35.4__tar.gz
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.
- {pyield-0.35.3 → pyield-0.35.4}/.gitignore +0 -6
- {pyield-0.35.3 → pyield-0.35.4}/PKG-INFO +1 -1
- pyield-0.35.4/pyield/__about__.py +1 -0
- {pyield-0.35.3 → pyield-0.35.4}/pyield/b3/di1.py +2 -2
- {pyield-0.35.3 → pyield-0.35.4}/pyield/bc/trades_intraday.py +12 -1
- {pyield-0.35.3 → pyield-0.35.4}/pyield/data_cache.py +5 -4
- pyield-0.35.3/pyield/__about__.py +0 -1
- {pyield-0.35.3 → pyield-0.35.4}/LICENSE +0 -0
- {pyield-0.35.3 → pyield-0.35.4}/README.md +0 -0
- {pyield-0.35.3 → pyield-0.35.4}/pyield/__init__.py +0 -0
- {pyield-0.35.3 → pyield-0.35.4}/pyield/anbima/__init__.py +0 -0
- {pyield-0.35.3 → pyield-0.35.4}/pyield/anbima/ettj.py +0 -0
- {pyield-0.35.3 → pyield-0.35.4}/pyield/anbima/ima.py +0 -0
- {pyield-0.35.3 → pyield-0.35.4}/pyield/anbima/imaq.py +0 -0
- {pyield-0.35.3 → pyield-0.35.4}/pyield/anbima/ipca.py +0 -0
- {pyield-0.35.3 → pyield-0.35.4}/pyield/anbima/tpf.py +0 -0
- {pyield-0.35.3 → pyield-0.35.4}/pyield/b3/__init__.py +0 -0
- {pyield-0.35.3 → pyield-0.35.4}/pyield/b3/di_over.py +0 -0
- {pyield-0.35.3 → pyield-0.35.4}/pyield/b3/futures/__init__.py +0 -0
- {pyield-0.35.3 → pyield-0.35.4}/pyield/b3/futures/common.py +0 -0
- {pyield-0.35.3 → pyield-0.35.4}/pyield/b3/futures/historical.py +0 -0
- {pyield-0.35.3 → pyield-0.35.4}/pyield/b3/futures/intraday.py +0 -0
- {pyield-0.35.3 → pyield-0.35.4}/pyield/b3/futures/xml.py +0 -0
- {pyield-0.35.3 → pyield-0.35.4}/pyield/bc/__init__.py +0 -0
- {pyield-0.35.3 → pyield-0.35.4}/pyield/bc/auction.py +0 -0
- {pyield-0.35.3 → pyield-0.35.4}/pyield/bc/bcdata.py +0 -0
- {pyield-0.35.3 → pyield-0.35.4}/pyield/bc/ptax.py +0 -0
- {pyield-0.35.3 → pyield-0.35.4}/pyield/bc/repo.py +0 -0
- {pyield-0.35.3 → pyield-0.35.4}/pyield/bc/trades_monthly.py +0 -0
- {pyield-0.35.3 → pyield-0.35.4}/pyield/bc/vna.py +0 -0
- {pyield-0.35.3 → pyield-0.35.4}/pyield/bday.py +0 -0
- {pyield-0.35.3 → pyield-0.35.4}/pyield/conftest.py +0 -0
- {pyield-0.35.3 → pyield-0.35.4}/pyield/date_converter.py +0 -0
- {pyield-0.35.3 → pyield-0.35.4}/pyield/fwd.py +0 -0
- {pyield-0.35.3 → pyield-0.35.4}/pyield/holidays/__init__.py +0 -0
- {pyield-0.35.3 → pyield-0.35.4}/pyield/holidays/br_holidays_new.txt +0 -0
- {pyield-0.35.3 → pyield-0.35.4}/pyield/holidays/br_holidays_old.txt +0 -0
- {pyield-0.35.3 → pyield-0.35.4}/pyield/holidays/brholidays.py +0 -0
- {pyield-0.35.3 → pyield-0.35.4}/pyield/ibge/__init__.py +0 -0
- {pyield-0.35.3 → pyield-0.35.4}/pyield/ibge/ipca.py +0 -0
- {pyield-0.35.3 → pyield-0.35.4}/pyield/interpolator.py +0 -0
- {pyield-0.35.3 → pyield-0.35.4}/pyield/py.typed +0 -0
- {pyield-0.35.3 → pyield-0.35.4}/pyield/retry.py +0 -0
- {pyield-0.35.3 → pyield-0.35.4}/pyield/tn/__init__.py +0 -0
- {pyield-0.35.3 → pyield-0.35.4}/pyield/tn/auction.py +0 -0
- {pyield-0.35.3 → pyield-0.35.4}/pyield/tn/lft.py +0 -0
- {pyield-0.35.3 → pyield-0.35.4}/pyield/tn/ltn.py +0 -0
- {pyield-0.35.3 → pyield-0.35.4}/pyield/tn/ntnb.py +0 -0
- {pyield-0.35.3 → pyield-0.35.4}/pyield/tn/ntnc.py +0 -0
- {pyield-0.35.3 → pyield-0.35.4}/pyield/tn/ntnf.py +0 -0
- {pyield-0.35.3 → pyield-0.35.4}/pyield/tn/tools.py +0 -0
- {pyield-0.35.3 → pyield-0.35.4}/pyproject.toml +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "0.35.4"
|
|
@@ -61,7 +61,7 @@ def data(
|
|
|
61
61
|
# Remove duplicates and sort dates
|
|
62
62
|
dates = dates.drop_duplicates().sort_values().reset_index(drop=True)
|
|
63
63
|
|
|
64
|
-
df = get_cached_dataset("
|
|
64
|
+
df = get_cached_dataset("di1").query("TradeDate in @dates").reset_index(drop=True)
|
|
65
65
|
|
|
66
66
|
today = dt.now(TIMEZONE_BZ)
|
|
67
67
|
last_bday = bday.last_business_day()
|
|
@@ -383,7 +383,7 @@ def eod_dates() -> pd.Series:
|
|
|
383
383
|
dtype: datetime64[ns]
|
|
384
384
|
"""
|
|
385
385
|
available_dates = (
|
|
386
|
-
get_cached_dataset("
|
|
386
|
+
get_cached_dataset("di1")
|
|
387
387
|
.drop_duplicates(subset=["TradeDate"])["TradeDate"]
|
|
388
388
|
.sort_values(ascending=True)
|
|
389
389
|
.reset_index(drop=True)
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Fetches real-time secondary trading data for domestic Federal Public Debt (FPD)
|
|
3
|
+
https://www.bcb.gov.br/htms/selic/selicprecos.asp?frame=1
|
|
4
|
+
"""
|
|
5
|
+
|
|
1
6
|
import datetime as dt
|
|
2
7
|
import io
|
|
3
8
|
import logging
|
|
@@ -18,7 +23,13 @@ test_file = Path(__file__).parent.parent.parent / "tests/data/negocios-registrad
|
|
|
18
23
|
|
|
19
24
|
|
|
20
25
|
def _fetch_csv_from_url() -> str:
|
|
21
|
-
|
|
26
|
+
"""
|
|
27
|
+
Example URL for the CSV file containing intraday trades data:
|
|
28
|
+
https://www3.bcb.gov.br/novoselic/rest/precosNegociacao/pub/download/estatisticas/02-06-2025
|
|
29
|
+
"""
|
|
30
|
+
today = dt.datetime.now(BZ_TIMEZONE).date()
|
|
31
|
+
formatted_date = today.strftime("%d-%m-%Y")
|
|
32
|
+
FILE_URL = f"https://www3.bcb.gov.br/novoselic/rest/precosNegociacao/pub/download/estatisticas/{formatted_date}"
|
|
22
33
|
r = requests.get(FILE_URL, timeout=30) # API usually takes 10s to respond
|
|
23
34
|
r.raise_for_status()
|
|
24
35
|
r.encoding = "iso-8859-15"
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import functools
|
|
2
2
|
import logging
|
|
3
3
|
from datetime import datetime
|
|
4
|
+
from typing import Literal
|
|
4
5
|
from zoneinfo import ZoneInfo
|
|
5
6
|
|
|
6
7
|
import pandas as pd
|
|
@@ -16,12 +17,12 @@ BASE_DATA_URL = f"{GIT_URL}/data"
|
|
|
16
17
|
|
|
17
18
|
# Dicionário global para configurações dos datasets usando 'filename'
|
|
18
19
|
DATASET_CONFIGS = {
|
|
19
|
-
"
|
|
20
|
+
"di1": {
|
|
20
21
|
"filename": "b3_di.parquet", # Apenas o nome do arquivo
|
|
21
22
|
"date_column": "TradeDate",
|
|
22
23
|
"name": "Futuro de DI (B3)",
|
|
23
24
|
},
|
|
24
|
-
"
|
|
25
|
+
"tpf": {
|
|
25
26
|
"filename": "anbima_tpf.parquet", # Apenas o nome do arquivo
|
|
26
27
|
"date_column": "ReferenceDate",
|
|
27
28
|
"name": "TPF (ANBIMA)",
|
|
@@ -73,6 +74,6 @@ def _get_dataset_with_ttl(dataset_id: str, date_key: str) -> pd.DataFrame:
|
|
|
73
74
|
raise # Re-raise a exceção para que o chamador saiba que falhou
|
|
74
75
|
|
|
75
76
|
|
|
76
|
-
def get_cached_dataset(dataset_id:
|
|
77
|
+
def get_cached_dataset(dataset_id: Literal["di1", "tpf"]) -> pd.DataFrame:
|
|
77
78
|
"""Obtém um dataset configurado pelo seu ID. O cache expira diariamente."""
|
|
78
|
-
return _get_dataset_with_ttl(dataset_id, _get_today_date_key())
|
|
79
|
+
return _get_dataset_with_ttl(dataset_id.lower(), _get_today_date_key())
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "0.35.3"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|