Name | dailytreasuryrates JSON |
Version |
0.4.5
JSON |
| download |
home_page | None |
Summary | Daily Treasury Rates Downloader |
upload_time | 2024-09-25 12:27:46 |
maintainer | None |
docs_url | None |
author | Thijs van den Berg |
requires_python | <4.0,>=3.8 |
license | MIT |
keywords |
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# Daily Treasury Rates Downloader
A simple command line tool for downloading or updating daily US interest rates (Par Yield Curve Rates) from the US Department of the Treasury.
## Installation
To install run:
~~~
> pip install dailytreasuryrates
~~~
## Usage
To create or update the file `rates.csv` with the latest treasury rates, run the following command:
~~~
> dailytreasuryrates rates.csv
~~~
This will look for the `rates.csv` file in the current folder and append any new data that is available for download on the US treasury site. You can also specify a fully qualitied path like `C:\dataset\myrates.csv` if you want to maintain the rates files at a different location.
A common usage for the rates-file it to load it into Python with Pandas for processing:
~~~
import pandas as pd
df = pd.read_csv('rates.csv', parse_dates=["Date"]).set_index("Date")
~~~
## Output format details
The output file is a `csv` file.
~~~
Date,1 Mo,2 Mo,3 Mo,4 Mo,6 Mo,1 Yr,2 Yr,3 Yr,5 Yr,7 Yr,10 Yr,20 Yr,30 Yr
1990-01-02,,,7.83,,7.89,7.81,7.87,7.9,7.87,7.98,7.94,,8.0
1990-01-03,,,7.89,,7.94,7.85,7.94,7.96,7.92,8.04,7.99,,8.04
...
2023-03-06,4.75,4.79,4.93,5.02,5.22,5.05,4.89,4.61,4.27,4.16,3.98,4.14,3.92
2023-03-07,4.8,4.88,5.04,5.12,5.32,5.22,5.0,4.66,4.31,4.17,3.97,4.11,3.88
~~~
* The first columns contains the date in `yyyy-mm-dd` format.
* Dates are sorted in ascending order.
* The first date is Jan 2nd 1990.
* The number of tenors has grown over time. E.g. in 1990 there was no `1 Month` and `2 Month` tennor, but now there is. These missing values for older dates have empty string in the csv file, as can be seen in the snipped above.
## Download details
Data gets downloaded from the U.S. DEPARTMENT OF THE TREASURY
: Daily Treasury Par Yield Curve Rates
[https://home.treasury.gov/resource-center/data-chart-center/interest-rates/TextView?type=daily\_treasury\_yield\_curve](https://home.treasury.gov/resource-center/data-chart-center/interest-rates/TextView?type=daily_treasury_yield_curve)
Raw data
{
"_id": null,
"home_page": null,
"name": "dailytreasuryrates",
"maintainer": null,
"docs_url": null,
"requires_python": "<4.0,>=3.8",
"maintainer_email": null,
"keywords": null,
"author": "Thijs van den Berg",
"author_email": "thijs@sitmo.com",
"download_url": "https://files.pythonhosted.org/packages/f2/f1/26b17b6088970fba2ab60aa180f19462c0e62f0a73c353178729a2504735/dailytreasuryrates-0.4.5.tar.gz",
"platform": null,
"description": "# Daily Treasury Rates Downloader\n\nA simple command line tool for downloading or updating daily US interest rates (Par Yield Curve Rates) from the US Department of the Treasury.\n\n\n## Installation\n\nTo install run:\n\n~~~\n> pip install dailytreasuryrates\n~~~\n\n## Usage\n\nTo create or update the file `rates.csv` with the latest treasury rates, run the following command:\n\n\n~~~\n> dailytreasuryrates rates.csv\n~~~\n\nThis will look for the `rates.csv` file in the current folder and append any new data that is available for download on the US treasury site. You can also specify a fully qualitied path like `C:\\dataset\\myrates.csv` if you want to maintain the rates files at a different location.\n\nA common usage for the rates-file it to load it into Python with Pandas for processing:\n\n~~~\nimport pandas as pd\n\ndf = pd.read_csv('rates.csv', parse_dates=[\"Date\"]).set_index(\"Date\")\n~~~\n\n\n## Output format details\nThe output file is a `csv` file.\n\n~~~\nDate,1 Mo,2 Mo,3 Mo,4 Mo,6 Mo,1 Yr,2 Yr,3 Yr,5 Yr,7 Yr,10 Yr,20 Yr,30 Yr\n1990-01-02,,,7.83,,7.89,7.81,7.87,7.9,7.87,7.98,7.94,,8.0\n1990-01-03,,,7.89,,7.94,7.85,7.94,7.96,7.92,8.04,7.99,,8.04\n...\n2023-03-06,4.75,4.79,4.93,5.02,5.22,5.05,4.89,4.61,4.27,4.16,3.98,4.14,3.92\n2023-03-07,4.8,4.88,5.04,5.12,5.32,5.22,5.0,4.66,4.31,4.17,3.97,4.11,3.88\n~~~\n\n* The first columns contains the date in `yyyy-mm-dd` format. \n* Dates are sorted in ascending order.\n* The first date is Jan 2nd 1990.\n* The number of tenors has grown over time. E.g. in 1990 there was no `1 Month` and `2 Month` tennor, but now there is. These missing values for older dates have empty string in the csv file, as can be seen in the snipped above.\n\n\n## Download details\n\nData gets downloaded from the U.S. DEPARTMENT OF THE TREASURY\n: Daily Treasury Par Yield Curve Rates\n\n\n[https://home.treasury.gov/resource-center/data-chart-center/interest-rates/TextView?type=daily\\_treasury\\_yield\\_curve](https://home.treasury.gov/resource-center/data-chart-center/interest-rates/TextView?type=daily_treasury_yield_curve)\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Daily Treasury Rates Downloader",
"version": "0.4.5",
"project_urls": null,
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "624db8aca50009ad18654d498ba0e4ea8e8f92fc8303f097267457a47333ea11",
"md5": "c2a04de0e72474cc7049b855f38de0cf",
"sha256": "1a1b6166cfd1262e636c8c0fb1587463a1ea022b9e414d40644465d0305c9ca8"
},
"downloads": -1,
"filename": "dailytreasuryrates-0.4.5-py3-none-any.whl",
"has_sig": false,
"md5_digest": "c2a04de0e72474cc7049b855f38de0cf",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<4.0,>=3.8",
"size": 145148,
"upload_time": "2024-09-25T12:27:45",
"upload_time_iso_8601": "2024-09-25T12:27:45.314586Z",
"url": "https://files.pythonhosted.org/packages/62/4d/b8aca50009ad18654d498ba0e4ea8e8f92fc8303f097267457a47333ea11/dailytreasuryrates-0.4.5-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "f2f126b17b6088970fba2ab60aa180f19462c0e62f0a73c353178729a2504735",
"md5": "9748a62f1273ba5347611ca338f17e79",
"sha256": "169c25ac250ca266fbc391a4dbbc7979798b1f76ff09d19abcc36bdd74c4587f"
},
"downloads": -1,
"filename": "dailytreasuryrates-0.4.5.tar.gz",
"has_sig": false,
"md5_digest": "9748a62f1273ba5347611ca338f17e79",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<4.0,>=3.8",
"size": 143064,
"upload_time": "2024-09-25T12:27:46",
"upload_time_iso_8601": "2024-09-25T12:27:46.883700Z",
"url": "https://files.pythonhosted.org/packages/f2/f1/26b17b6088970fba2ab60aa180f19462c0e62f0a73c353178729a2504735/dailytreasuryrates-0.4.5.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-09-25 12:27:46",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "dailytreasuryrates"
}