dgunning / edgartools

Navigate SEC Edgar data in Python
MIT License
522 stars 104 forks source link

Add a fallback for the CIK lookup. #123

Closed MauritsBrinkman closed 1 month ago

MauritsBrinkman commented 1 month ago

I have an application running in production and today I experienced an issue when there was an outage of the edgar web page that is used by the CIK lookup. Although edgartools uses the @lru_cache decorator, this didn't prevent the Company object from giving an error because it couldn't use the CIK lookup. Luckily, this case might be solved easily by having a fallback that is dependent on this JSON file provided by SEC.

The lookup is dependent on ticker.txt: tab-delimited text file (ticker.txt) for ticker / CIK. This is fragile, as it might be (although we have caching) that an outage of this source results in failure of the Company() object. Now, having company_tickers.json as a second fallback for the JSON object, an outage of the ticker.txt will not necessarily result in an error for the use of the Company().

dgunning commented 1 month ago

Was this due to the SEC outage this afternoon? Could the outage and future outage affect both cik lookups?

I'm also thinking of making more of edgartools use local storage, including the cik lookup