Skip to content

Commit

Permalink
feat: Introduce Location enum for improved location handling
Browse files Browse the repository at this point in the history
- Added a new `Location` enum in `constants.py` to standardize
    location inputs across the application.
- Updated `text_search` function in `cli.py` to use `Location` type
    for `peo_in` and `inc_in` parameters.
- Modified `url_generator.py` to accept `Location` type for `peo_in`
    and `inc_in` in the `SearchQueryKwargs` class.
- Refactored tests in `test_url_generator.py` to validate the new
    `Location` enum usage.
- Enhanced test cases to ensure correct mapping of locations in\
    various contexts.
  • Loading branch information
jordan-gillard committed Jan 8, 2025
1 parent 5752754 commit 32b2f02
Show file tree
Hide file tree
Showing 5 changed files with 948 additions and 624 deletions.
7 changes: 3 additions & 4 deletions edgar_tool/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,9 @@

import click
import typer
from dateutil.relativedelta import relativedelta
from typing_extensions import Annotated

from .constants import DateRange, FilingCategory
from .constants import DateRange, FilingCategory, Location
from .text_search import EdgarTextSearcher

app = typer.Typer(name="edgar-tool", no_args_is_help=True)
Expand Down Expand Up @@ -92,7 +91,7 @@ def text_search(
),
] = None,
peo_in: Annotated[
Optional[str],
Location,
typer.Option(
"--principal-executive-offices-in",
"-peoi",
Expand All @@ -106,7 +105,7 @@ def text_search(
),
] = None,
inc_in: Annotated[
Optional[str],
Location,
typer.Option(
"--incorporated-in",
"-ii",
Expand Down
Loading

0 comments on commit 32b2f02

Please sign in to comment.