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

Location based search #22 #28

Merged
merged 8 commits into from
Jun 10, 2024

Conversation

JackCollins91
Copy link
Contributor

@JackCollins91 JackCollins91 commented Jun 2, 2024

Closes Issue #22

edgar-tool now supports parameters inc_in for 'incorporated_in' and peo_in for 'principal executive offices in.'

both parameters takes a string like "NY" or "NY, OH." Any country code in edgar_tool.constants.TEXT_SEARCH_LOCATIONS_MAPPING is supported.

Also, the country names as per TEXT_SEARCH_LOCATIONS_MAPPING.values() are accepted. Whitespace and upper/lower casing should be ignored, and so therefore, "mexico,ny" and "MexicO, Ny" will both convert to "NY,O5"

Malformed input will result in the dictionary for edgar_tool.constants.TEXT_SEARCH_LOCATIONS_MAPPING being printed in the console so the user can see what codes they can use.

I tested the following commands for both correct, incorrect, and unrelated use cases, I have pasted the results of that run in the attached file.

$ poetry run edgar-tool text_search Tsunami Hazards --start_date "2019-06-01" --end_date "2024-01-01" --output "results.csv" --peo_in "NY, OH"
$ poetry run edgar-tool text_search Tsunami Hazards --start_date "2019-06-01" --end_date "2024-01-01" --output "results.csv" --peo_in "NY"
$ poetry run edgar-tool text_search Tsunami Hazards --start_date "2019-06-01" --end_date "2024-01-01" --output "results.csv" --inc_in "NY, OH, O5"
$ poetry run edgar-tool text_search Tsunami Hazards --start_date "2019-06-01" --end_date "2024-01-01" --output "results.csv" --inc_in "NY"
$ poetry run poetry run edgar-tool text_search Tsunami Hazards --start_date "2019-06-01" --end_date "2024-01-01" --output "results.csv" --peo_in "NY, Korea, Democratic People's Republic of, OH, Mexico"
$ poetry run poetry run edgar-tool text_search Tsunami Hazards --start_date "2019-06-01" --end_date "2024-01-01" --output "results.csv" --inc_in "Korea, Democratic People's Republic of"
$ poetry run edgar-tool text_search Tsunami Hazards --output "results.csv" --inc_in "Mexico"
$ poetry run poetry run edgar-tool text_search Tsunami Hazards --start_date "2019-06-01" --end_date "2024-01-01" --output "results.csv" --peo_in "mexico"
$ poetry run poetry run edgar-tool text_search Tsunami Hazards --start_date "2019-06-01" --end_date "2024-01-01" --output "results.csv" --inc_in "kOrEa, demOcratic people's republic of, OH"
$ poetry run edgar-tool text_search Tsunami Hazards --output "results.csv" --peo_in "hello world"
$ poetry run edgar-tool text_search Tsunami Hazards --output "results.csv" --inc_in 123
$ poetry run edgar-tool text_search Tsunami Hazards --start_date "2019-06-01" --end_date "2024-01-01" --output "results.csv" --inc_in "NY" --peo_in "NY, OH"
$ poetry run edgar-tool text_search Tsunami Hazards --start_date "2019-06-01" --end_date "2024-01-01" --output "results.csv"

test cli session.txt

@GalenReich GalenReich linked an issue Jun 3, 2024 that may be closed by this pull request
edgar_tool/utils.py Outdated Show resolved Hide resolved
Now values like 'Mexico' are supported instead of just 'O5'
"mexico"  or ", MeXiCo " will now work the same as "Mexico" which is the same as "O5"
@JackCollins91
Copy link
Contributor Author

Hi @GalenReich, PR is updated per your request. I also updated the initial comment to reflect changes. The attached .txt file shows the results of the latest testing. I added some new test cases which are detailed there also.

@GalenReich GalenReich merged commit a21c559 into bellingcat:main Jun 10, 2024
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.

Location-based Search
3 participants