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

Create new URL encoding function to align with SEC API #40

Merged
merged 21 commits into from
Oct 24, 2024

Conversation

jordan-gillard
Copy link
Contributor

This PR is creates the generate_search_url_for_kwargs function to align the EDGAR CLI's generated URLs more closely with the actual EDGAR API. Here are the main differences:

old new
Relative dates are converted to custom dates (i.e. 10y is converted to &dateRange=custom&startdt=2014-09-07&enddt=2024-09-07) Relative dates (like 10y) use the SEC API query &dateRange=10y in URLs
Filing categories are converted to large lists of individual forms Filing categories are converted to the SEC API's filing category code
Users specify locations using the SEC UI's exact text for the location Users specify locations using ISO-3166 internationally approved alpha codes (i.e. instead of having to write Holy See (Vatican City State) exactly correct on the command line, user's use the international abbrevation, "VAT")

There are also 645 tests for URL generation. All incorporated/principal office ISO codes to SEC location are tested.

Please note that this PR does not replace the existing URL-generation code. This PR is already huge enough and I will do that in a follow-up PR.

@GalenReich GalenReich merged commit 8d495cd into bellingcat:main Oct 24, 2024
4 checks passed
@jordan-gillard jordan-gillard deleted the improved-url-generation branch October 28, 2024 03:08
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