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

Fix econcal endpoint #5567

Merged
merged 4 commits into from
Oct 16, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -444,9 +444,9 @@ def test_economy_gdpforecast(params, obb):
{
"start_date": "2023-01-01",
"end_date": "2023-06-06",
"country": "Portugal",
"country": "portugal",
"importance": 1,
"group": "money",
"group": "gdp",
}
),
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ def gdpforecast(
return OBBject(results=Query(**locals()).execute())


@router.command(model="EconCal")
@router.command(model="EconomicCalendar")
def econcal(
cc: CommandContext,
provider_choices: ProviderChoices,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@
website="https://tradingeconomics.com/",
description="""Trading Economics""",
required_credentials=["api_key"],
fetcher_dict={"EconCal": TEEarningsCalendarFetcher},
fetcher_dict={"EconomicCalendar": TEEarningsCalendarFetcher},
)
Original file line number Diff line number Diff line change
Expand Up @@ -74,5 +74,10 @@ def generate_url(in_query):
# Group + Date
elif check_args(query, ["group", "start_date", "end_date"]):
url = f'{base_url}/group/{query["group"]}/{query["start_date"]}/{query["end_date"]}?c='
# All fields
elif check_args(
query, ["country", "group", "importance", "start_date", "end_date"]
):
url = f'{base_url}/country/{country}/group/{group}/{query["start_date"]}/{query["end_date"]}?{urlencode(query)}&c='

return url if url else ""
Loading