pull_bondret_treasury#
Functions to pull and save treasury returns data.
Data source: https://openbondassetpricing.com/wp-content/uploads/2024/06/bondret_treasury.csv
This module provides functions to download the treasury returns CSV file from the given URL and save it to a local data directory. You can later load the saved file for further analysis.
Module Contents#
Functions#
Pulls the treasury returns CSV file from the specified URL. |
|
Loads the locally saved treasury returns file. |
|
Data#
API#
- pull_bondret_treasury.DATA_DIR#
βPath(β¦)β
- pull_bondret_treasury.BOND_TREASURY_URL#
βhttps://openbondassetpricing.com/wp-content/uploads/2024/06/bondret_treasury.csvβ
- pull_bondret_treasury.pull_bondret_treasury_file(url=BOND_TREASURY_URL)#
Pulls the treasury returns CSV file from the specified URL.
Parameters
url : str, optional URL of the CSV file containing treasury returns data, by default BOND_TREASURY_URL
Returns
pd.DataFrame DataFrame with the treasury returns data.
- pull_bondret_treasury.load_bondret_treasury_file(data_dir=DATA_DIR)#
Loads the locally saved treasury returns file.
Parameters
data_dir : Path, optional The directory where the treasury returns file is saved, by default DATA_DIR
Returns
pd.DataFrame DataFrame with the treasury returns data.
- pull_bondret_treasury._demo()#