1

I have 3 simple lines of code which pull S-1 filings from the SEC's "Edgar" database and put them into a folder I specify. This uses the "sec Edgar downloader." It works great, but I have to do this for about 1400 companies.

I have the list of tickers in a separate excel spreadsheet. I assume that there must be a way to do this recursively so that it automatically looks up all the tickers I have.

See, the code I already have. I used Starbucks (it's stock ticker "SBUX") as the example company. I don't want to have to redo these 3 lines 1,400 times and manually input all the different tickers.

import sec_edgar_downloader
downloader = sec_edgar_downloader.Downloader(r"C:\Users\Steve\AppData\Local\Programs\Python\Python37-32\Outputs")
downloader.get_s1_filing_for_ticker("SBUX")

I expect a code that would look like this:

import sec_edgar_downloader
downloader = sec_edgar_downloader.Downloader(r"C:\Users\Steve\AppData\Local\Programs\Python\Python37-32\Outputs")
downloader.get_s1_filing_for_ticker(special.code.to.pull.from.list)

Or possibly use some kind of for-loop structure, etc.

Thanks in advance for all the help and suggestions!

Majo_Jose
  • 744
  • 1
  • 10
  • 24

1 Answers1

1

You are close to done! :-)

import sec_edgar_downloader
downloader = sec_edgar_downloader.Downloader(r"C:\Users\Steve\AppData\Local\Programs\Python\Python37-32\Outputs")

for ticker in ticker_list:
     downloader.get_s1_filing_for_ticker(ticker)

Here ticker list will look like this:

ticker_list = ["SBUX","SBAX", "UBIX","TAXA" ] 

and so on.

Christian Sloper
  • 7,440
  • 3
  • 15
  • 28