Add a fallback for the CIK lookup. #123
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 theCompany
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().