Skip to main content

Pulls the real and nominal yield curves from the US Treasury's website for a date range (inclusive)

Project description

USTreasuryCurve

This code pulls in the nominal and real yield curves from the US Treasury's website for a date range (inclusive) into a Pandas dataframe. The nominal rates start on January 2, 1990 and the real rates begin on January 2, 2003. The US Treasury updates these yields daily.

Install package

pip install ustreasurycurve

Usage

import ustreasurycurve as ustcurve

Pull in nominal US Treasury curve

ustcurve = ustcurve.nominalRates('2010-06-30', '2022-06-30')

Pull in real US Treasury curve

ustrcurve = ustcurve.realRates('2010-06-30', '2022-06-30')

Pull in nominal US Treasury curve using an unverified HTTPS request

ustcurve = ustcurve.nominalRates('2010-06-30', '2022-06-30', False)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ustreasurycurve-0.0.7.tar.gz (3.2 kB view hashes)

Uploaded Source

Built Distribution

ustreasurycurve-0.0.7-py3-none-any.whl (4.5 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page