PYield 0.9.4__tar.gz → 0.9.5__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.9.4 → pyield-0.9.5}/PKG-INFO +2 -2
- {pyield-0.9.4 → pyield-0.9.5}/README.md +1 -1
- pyield-0.9.5/pyield/__about__.py +1 -0
- {pyield-0.9.4 → pyield-0.9.5}/pyield/fetchers/anbima.py +3 -3
- {pyield-0.9.4 → pyield-0.9.5}/pyield/fetchers/futures/intraday.py +3 -2
- {pyield-0.9.4 → pyield-0.9.5}/pyield/ntnb.py +1 -1
- {pyield-0.9.4 → pyield-0.9.5}/pyield/spreads.py +1 -1
- {pyield-0.9.4 → pyield-0.9.5}/pyproject.toml +1 -1
- pyield-0.9.4/pyield/__about__.py +0 -1
- {pyield-0.9.4 → pyield-0.9.5}/LICENSE +0 -0
- {pyield-0.9.4 → pyield-0.9.5}/pyield/__init__.py +0 -0
- {pyield-0.9.4 → pyield-0.9.5}/pyield/bday.py +0 -0
- {pyield-0.9.4 → pyield-0.9.5}/pyield/date_validator.py +0 -0
- {pyield-0.9.4 → pyield-0.9.5}/pyield/fetchers/__init__.py +0 -0
- {pyield-0.9.4 → pyield-0.9.5}/pyield/fetchers/futures/__init__.py +0 -0
- {pyield-0.9.4 → pyield-0.9.5}/pyield/fetchers/futures/common.py +0 -0
- {pyield-0.9.4 → pyield-0.9.5}/pyield/fetchers/futures/historical.py +0 -0
- {pyield-0.9.4 → pyield-0.9.5}/pyield/fetchers/futures/xml.py +0 -0
- {pyield-0.9.4 → pyield-0.9.5}/pyield/fetchers/indicators.py +0 -0
- {pyield-0.9.4 → pyield-0.9.5}/pyield/fetchers/projections.py +0 -0
- {pyield-0.9.4 → pyield-0.9.5}/pyield/holidays/__init__.py +0 -0
- {pyield-0.9.4 → pyield-0.9.5}/pyield/holidays/br_holidays_new.txt +0 -0
- {pyield-0.9.4 → pyield-0.9.5}/pyield/holidays/br_holidays_old.txt +0 -0
- {pyield-0.9.4 → pyield-0.9.5}/pyield/holidays/holidays_manager.py +0 -0
- {pyield-0.9.4 → pyield-0.9.5}/pyield/interpolators.py +0 -0
- {pyield-0.9.4 → pyield-0.9.5}/pyield/py.typed +0 -0
- {pyield-0.9.4 → pyield-0.9.5}/tests/__init__.py +0 -0
- {pyield-0.9.4 → pyield-0.9.5}/tests/data/SPRD231222.zip +0 -0
- {pyield-0.9.4 → pyield-0.9.5}/tests/data/SPRD240426.zip +0 -0
- {pyield-0.9.4 → pyield-0.9.5}/tests/test_bday.py +0 -0
- {pyield-0.9.4 → pyield-0.9.5}/tests/test_futures.py +0 -0
- {pyield-0.9.4 → pyield-0.9.5}/tests/test_futures_xml.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: PYield
|
|
3
|
-
Version: 0.9.
|
|
3
|
+
Version: 0.9.5
|
|
4
4
|
Summary: A Python library for analysis of fixed income instruments in Brazil
|
|
5
5
|
Keywords: fixed-income, brazil, finance, analysis, bonds
|
|
6
6
|
Author-Email: Carlos Carvalho <cr.cj@outlook.com>
|
|
@@ -127,7 +127,7 @@ TradeDate TickerSymbol ExpirationDate BDaysToExp ... LastRate LastAskRate LastB
|
|
|
127
127
|
# Fetch a DataFrame with the NTN-B data from ANBIMA
|
|
128
128
|
# Anbima data is available for the last 5 working days
|
|
129
129
|
# Obs: Anbima members have access to the full history
|
|
130
|
-
>>> yd.anbima(
|
|
130
|
+
>>> yd.anbima(bond_type='NTN-B', reference_date='12-04-2024')
|
|
131
131
|
|
|
132
132
|
BondType ReferenceDate MaturityDate BidRate AskRate IndicativeRate Price
|
|
133
133
|
NTN-B 2024-04-12 2024-08-15 0.07540 0.07504 0.07523 4,271.43565
|
|
@@ -84,7 +84,7 @@ TradeDate TickerSymbol ExpirationDate BDaysToExp ... LastRate LastAskRate LastB
|
|
|
84
84
|
# Fetch a DataFrame with the NTN-B data from ANBIMA
|
|
85
85
|
# Anbima data is available for the last 5 working days
|
|
86
86
|
# Obs: Anbima members have access to the full history
|
|
87
|
-
>>> yd.anbima(
|
|
87
|
+
>>> yd.anbima(bond_type='NTN-B', reference_date='12-04-2024')
|
|
88
88
|
|
|
89
89
|
BondType ReferenceDate MaturityDate BidRate AskRate IndicativeRate Price
|
|
90
90
|
NTN-B 2024-04-12 2024-08-15 0.07540 0.07504 0.07523 4,271.43565
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "0.9.5"
|
|
@@ -90,8 +90,8 @@ def _process_raw_df(df_raw: pd.DataFrame) -> pd.DataFrame:
|
|
|
90
90
|
|
|
91
91
|
|
|
92
92
|
def anbima(
|
|
93
|
-
reference_date: str | pd.Timestamp | None = None,
|
|
94
93
|
bond_type: str | list[str] | None = None,
|
|
94
|
+
reference_date: str | pd.Timestamp | None = None,
|
|
95
95
|
) -> pd.DataFrame:
|
|
96
96
|
"""
|
|
97
97
|
Fetches indicative treasury rates from ANBIMA for a specified reference date.
|
|
@@ -100,10 +100,10 @@ def anbima(
|
|
|
100
100
|
ANBIMA, processing them into a structured pandas DataFrame.
|
|
101
101
|
|
|
102
102
|
Args:
|
|
103
|
+
bond_type (str, optional): The type of bond to filter by. Defaults to None.
|
|
103
104
|
reference_date (str | pd.Timestamp | None, optional): The date for which to
|
|
104
105
|
fetch the indicative rates. If a string is provided, it should be in the
|
|
105
106
|
format 'dd-mm-yyyy'. Defaults last business day if None.
|
|
106
|
-
bond_type (str, optional): The type of bond to filter by. Defaults to None.
|
|
107
107
|
|
|
108
108
|
Returns:
|
|
109
109
|
pd.DataFrame: A DataFrame containing the processed indicative rates for the
|
|
@@ -117,7 +117,7 @@ def anbima(
|
|
|
117
117
|
# Fetch ANBIMA data for all bonds using the last business day available
|
|
118
118
|
>>> yd.anbima("18-06-2024")
|
|
119
119
|
# Fetch ANBIMA data for NTN-B bonds using a specific reference date
|
|
120
|
-
>>> yd.anbima("
|
|
120
|
+
>>> yd.anbima("NTN-B", "18-06-2024")
|
|
121
121
|
"""
|
|
122
122
|
# Normalize the reference date
|
|
123
123
|
normalized_date = dv.normalize_date(reference_date)
|
|
@@ -167,8 +167,9 @@ def fetch_intraday_df(future_code: str) -> pd.DataFrame:
|
|
|
167
167
|
pd.DataFrame: A Pandas pd.DataFrame containing the latest DI futures data.
|
|
168
168
|
"""
|
|
169
169
|
raw_df = _fetch_b3_df(future_code)
|
|
170
|
-
if raw_df.
|
|
171
|
-
|
|
170
|
+
if "buyOffer" not in raw_df.columns:
|
|
171
|
+
# Return an empty DataFrame if the data is not available
|
|
172
|
+
return pd.DataFrame()
|
|
172
173
|
df = _process_df(raw_df)
|
|
173
174
|
df = _select_and_reorder_columns(df)
|
|
174
175
|
return df
|
|
@@ -35,7 +35,7 @@ def ytm_rates(reference_date: str | pd.Timestamp) -> pd.DataFrame:
|
|
|
35
35
|
Returns:
|
|
36
36
|
pd.DataFrame: A DataFrame containing the maturity dates and corresponding rates.
|
|
37
37
|
"""
|
|
38
|
-
df = anbima(
|
|
38
|
+
df = anbima("NTN-B", reference_date)
|
|
39
39
|
|
|
40
40
|
# Keep only the relevant columns for the output
|
|
41
41
|
keep_columns = ["ReferenceDate", "BondType", "MaturityDate", "IndicativeRate"]
|
|
@@ -76,7 +76,7 @@ def di_pre(reference_date: pd.Timestamp) -> pd.DataFrame:
|
|
|
76
76
|
df_di["MaturityDate"] = df_di["MaturityDate"].dt.to_period("M").dt.to_timestamp()
|
|
77
77
|
|
|
78
78
|
# Fetch bond rates, filtering for LTN and NTN-F types
|
|
79
|
-
df_anbima = anbima(
|
|
79
|
+
df_anbima = anbima(["LTN", "NTN-F"], reference_date)
|
|
80
80
|
# Keep only the relevant columns for the output
|
|
81
81
|
keep_columns = ["ReferenceDate", "BondType", "MaturityDate", "IndicativeRate"]
|
|
82
82
|
df_anbima = df_anbima[keep_columns].copy()
|
pyield-0.9.4/pyield/__about__.py
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "0.9.4"
|
|
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
|