1

I am trying to execute this script:

import time
from SECEdgar.crawler import SecCrawler

def get_filings():
    t1 = time.time()

    # create object
    seccrawler = SecCrawler()

    companyCode = 'AAPL'    # company code for apple 
    cik = '0000320193'      # cik code for apple
    date = '20010101'       # date from which filings should be downloaded
    count = '10'            # no of filings

    seccrawler.filing_10Q(str(companyCode), str(cik), str(date), str(count))
    seccrawler.filing_10K(str(companyCode), str(cik), str(date), str(count))
    seccrawler.filing_8K(str(companyCode), str(cik), str(date), str(count))
    seccrawler.filing_13F(str(companyCode), str(cik), str(date), str(count))

    t2 = time.time()
    print "Total Time taken: ",
    print (t2-t1)

if __name__ == '__main__':
    get_filings() 

I am putting this code in a file filings.py , then attempt to run it from terminal (Mac user)

python filings.py

But I am getting the following error:

Traceback (most recent call last):
  File "filings.py", line 2, in <module>
    from SECEdgar.crawler import SecCrawler
  File "build/bdist.macosx-10.10-intel/egg/SECEdgar/crawler.py", line 6, in <module>
  File "build/bdist.macosx-10.10-intel/egg/SECEdgar/config.py", line 22, in <module>
  File "/Library/Python/2.7/site-packages/configparser.py", line 995, in __getitem__
    raise KeyError(key)
KeyError: 'Paths'

What am I doing wrong?

2
  • 1
    Have you followed the proper steps of installation of the SEC-Edgar as mentioned in the site? Commented Feb 18, 2015 at 15:31
  • Check your SECEdgar/default.cfg file. Commented Feb 18, 2015 at 15:33

2 Answers 2

1

Looks like there's an error in the package you installed. Try uninstalling and reinstalling.

pip uninstall SECEdgar

pip install SECEdgar
Sign up to request clarification or add additional context in comments.

Comments

0

I found the solution, it was basically a quite silly thing:

date = '20010101'       # date from which filings should be downloaded

should be

date = '20010101'       # date UNTIL which filings should be downloaded

so if you put the starting date you would end up with download 0 files, but if you put the end date then you would download them all successfully, seems to be working OK now :)

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.