Skip to content

Given a list of savings bond serial numbers, find the values, maturity dates, etc.

License

Notifications You must be signed in to change notification settings

macohen/bond_value_scraper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Bond Value Scraper

I wish there was a way to bulk upload a spreadsheet of bond serial numbers to https://www.treasurydirect.gov/BC/SBCPrice. There isn't. So I wrote a python script with Selenium Webdriver to parse a CSV containing the info needed to fill out the form and run it automatically.

Then, you just need to click save and copy and paste the table back into a spreadsheet for fiddling.

Run

  1. Use Python 3.2+
  2. pip install -r requirements.txt
  3. Install geckodriver on your PATH for Firefox support
  4. copy your bonds.csv file to the root. don't add it to git, please. I don't want to know
  5. python bond_scraper.py --value_as_of=<month and year you want to calculate the value for> --bond_csv=<the file with the list of bonds to calculate>
    • --value_as_of=11/2017
    • --bond_csv=sample_bonds.csv (see included sample_bonds.csv for reference format)
  6. Once the script is done, you should be able to go to the Firefox instance that Selenium opened and save the results as a file

About

Given a list of savings bond serial numbers, find the values, maturity dates, etc.

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages