Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a fallback for the CIK lookup. #123

Merged
merged 1 commit into from
Oct 8, 2024

Conversation

MauritsBrinkman
Copy link
Contributor

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().

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(<ticker>) 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(<ticker>).
@dgunning
Copy link
Owner

dgunning commented Oct 7, 2024

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

Copy link
Owner

@dgunning dgunning left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. The fallback adds a little redundancy though it's possible that both urls might be down at the same time.

I will approve test and integrate

@dgunning dgunning merged commit 01eb23e into dgunning:main Oct 8, 2024
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants