Skip to content

Commit

Permalink
Create new URL encoding function to align with SEC API (#40)
Browse files Browse the repository at this point in the history
* Update README
  * examples w/ x-platform escape chars
  *exact search instructions

* feat: Add support for single forms
* feat: Add search param validator and basic tests

* test: Add invalid arg tests
* test: Add invalid custom date tests
* test: Raises error for invalid date_range_select
* test: Add tests for all date options
* test: Add test for invalid peo_in
* test: Add tests for incorportated in

* Add filing categories to url_generator
* Remove duplicate filing category to form id code
* Amend me! Add TODO for remaining work
* Add ISO 3166-1/2 country codes to EDGAR codes
* Add urls for remaining countries
* Update url_generator to use EDGAR API URL
* Use urllib.parse.quote to encode quote characters
* Avoid double escaping keywords in url and handle single quotes
---------

Co-authored-by: Galen Reich <[email protected]>
  • Loading branch information
jordan-gillard and GalenReich authored Oct 24, 2024
1 parent b993491 commit 8d495cd
Show file tree
Hide file tree
Showing 8 changed files with 1,264 additions and 172 deletions.
41 changes: 32 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,26 +38,49 @@ This is a command line tool that takes a search query, queries a server, and dow

### Examples

```bash
# Display help message describing all supported arguments along with their usage, aliases and eventual default values (type q to exit)
Display help message describing all supported arguments along with their usage, aliases and eventual default values (type `q` to exit)

```shell
edgar-tool text_search --help
```

Basic usage (defaults to searching the last 5 years of records)

# Basic usage (defaults to searching the last 5 years of records)
```shell
edgar-tool text_search John Doe
```

You can wrap a phrase in quotes if you want an exact match.
This works in both POSIX-compliant shells (Linux/Bash) and Windows PowerShell environments.

# Basic usage with a combination of exact and partial search parameters
edgar-tool text_search \"John Doe\" Pharmaceuticals Chemicals
For example, the following usage will search for the exact phrase `"John Doe"` and treat `Pharmaceuticals` and
`Chemicals` as partial search parameters.

```shell
edgar-tool text_search "John Doe" Pharmaceuticals Chemicals
```

# Usage with date range and export to custom CSV file
Usage with date range and export to custom CSV file

```shell
edgar-tool text_search Tsunami Hazards --start_date "2021-01-01" --end_date "2021-12-31" --output "results.csv"
```

# Usage with a partial set of filing forms + single forms
### Usage with a partial set of filing forms + single forms

```
edgar-tool text_search Hurricane Damage --filing_form "registration_statements" --single_forms "['1-K', '1-SA']"
```

Usage specifying the location of incorporation

# Usage specifying the location of incorporation
```shell
edgar-tool text_search oil --inc_in "Egypt"
```

More advanced usage specifying more arguments, with export to JSON

# More advanced usage specifying more arguments, with export to JSON
```shell
edgar-tool text_search Volcano Monitoring --start_date "2021-01-01" --end_date "2021-12-31" --output "results.json"\
--filing_form "all_annual_quarterly_and_current_reports" --entity_id "0001030717" \
--min_wait 5.0 --max_wait 7.0 --retries 3
Expand Down
4 changes: 2 additions & 2 deletions edgar_tool/main.py → edgar_tool/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
from edgar_tool.cli import SecEdgarScraperCli


def main_entrypoint():
def main():
fire.Fire(SecEdgarScraperCli)


if __name__ == "__main__":
main_entrypoint()
main()
Loading

0 comments on commit 8d495cd

Please sign in to comment.