Skip to content

Commit

Permalink
Add user agent for US Fed download (#958)
Browse files Browse the repository at this point in the history
* set defaults to single year, limited counties to temporarily have script finish in <1 for autorefresh test

* lint fix

* lint fix

* set user-agent for downloads

* set user-agent for downloads
  • Loading branch information
ajaits authored Dec 19, 2023
1 parent 355d43d commit da5f6f6
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,9 @@ def generate_csv():
name_template = "Market yield on U.S. Treasury securities at {} constant"\
" maturity, quoted on investment basis"

in_df = pd.read_csv(CSV_URL, na_values="ND")
in_df = pd.read_csv(CSV_URL,
na_values="ND",
storage_options={"User-Agent": "Python-Pandas"})

out_df["date"] = in_df["Series Description"][header_rows:]
for maturity in MATURITIES:
Expand Down

0 comments on commit da5f6f6

Please sign in to comment.