npezolano / PyTreasuryDirect

Python API for Treasury Direct
MIT License
18 stars 6 forks source link

PyTreasuryDirect

PyTreasuryDirect is a thin wrapper on top of the Treasury Direct Web API

To Start

PyTreasuryDirect uses the Requests Python package. To install:

pip install PyTreasuryDirect

Example

from pytreasurydirect import TreasuryDirect

td = TreasuryDirect()
cusip = '912796CJ6'

print(td.security_info(cusip, '02/11/2014'))
# or 
print(td.security_info(cusip, datetime.date(2014, 2, 11)))