EDGAR icon indicating copy to clipboard operation
EDGAR copied to clipboard

Create new URL encoding function to align with SEC API

Open jordan-gillard opened this issue 5 months ago • 0 comments

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.

jordan-gillard avatar Sep 08 '24 00:09 jordan-gillard