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

[Feature] Add IMF Provider Extension and Extend obb.economic.indicators #6666

Merged
merged 9 commits into from
Sep 20, 2024
Merged
Show file tree
Hide file tree
Changes from 8 commits
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
8 changes: 8 additions & 0 deletions assets/extensions/provider.json
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,14 @@
"credentials": [],
"website": "https://data.gov"
},
{
"packageName": "openbb-imf",
"optional": false,
"reprName": "International Monetary Fund (IMF) Public Data API",
"description": "This provider allows you to access International Monetary Fund data through the IMF Public Data API.",
"credentials": [],
"website": "https://datahelp.imf.org/knowledgebase/articles/667681-using-json-restful-web-service"
},
{
"packageName": "openbb-intrinio",
"optional": false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,6 @@
class EconomicIndicatorsQueryParams(QueryParams):
"""Economic Indicators Query."""

symbol: str = Field(
description=QUERY_DESCRIPTIONS.get("symbol", "")
+ " The base symbol for the indicator (e.g. GDP, CPI, etc.).",
)
country: Optional[str] = Field(
default=None,
description=QUERY_DESCRIPTIONS.get("country", "")
Expand Down
1 change: 1 addition & 0 deletions openbb_platform/dev_install.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
openbb-federal-reserve = { path = "./providers/federal_reserve", develop = true }
openbb-fmp = { path = "./providers/fmp", develop = true }
openbb-fred = { path = "./providers/fred", develop = true }
openbb-imf = { path = "./providers/imf", develop = true }
openbb-intrinio = { path = "./providers/intrinio", develop = true }
openbb-oecd = { path = "./providers/oecd", develop = true }
openbb-polygon = { path = "./providers/polygon", develop = true }
Expand Down
20 changes: 20 additions & 0 deletions openbb_platform/extensions/economy/integration/test_economy_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -609,6 +609,26 @@ def test_economy_fred_regional(params, headers):
"frequency": "quarter",
}
),
(
{
"provider": "imf",
"country": "us,uk,jp",
"symbol": "gold_reserves",
"start_date": "2022-01-01",
"end_date": "2023-12-31",
"frequency": "annual",
}
),
(
{
"provider": "imf",
"country": "all",
"symbol": "derivative_assets",
"start_date": "2022-01-01",
"end_date": "2023-12-31",
"frequency": "annual",
}
),
],
)
@pytest.mark.integration
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -629,6 +629,26 @@ def test_economy_available_indicators(params, obb):
"frequency": "quarter",
}
),
(
{
"provider": "imf",
"country": "us,uk,jp",
"symbol": "gold_reserves",
"start_date": "2022-01-01",
"end_date": "2023-12-31",
"frequency": "annual",
}
),
(
{
"provider": "imf",
"country": "all",
"symbol": "derivative_assets",
"start_date": "2022-01-01",
"end_date": "2023-12-31",
"frequency": "annual",
}
),
],
)
@pytest.mark.integration
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -411,6 +411,29 @@ async def available_indicators(
description="Use the `main` symbol to get the group of main indicators for a country.",
parameters={"provider": "econdb", "symbol": "main", "country": "eu"},
),
APIEx(
description="When the provider is 'imf', the absence of a symbol will default to 'irfcl_top_lines'."
+ " Use 'IRFCL' to get all the data from the set of indicators.",
parameters={"provider": "imf"},
),
APIEx(
description="When the provider is 'imf', complete tables are returned by using a 'preset'."
+ " Refer to the function's docstring for descriptions of each preset."
+ " When no country is supplied, the data is returned for all countries.",
parameters={"provider": "imf", "symbol": "gold_reserves"},
),
APIEx(
description="When the provider is 'imf', multiple countries and symbols can be supplied."
+ " Enter countries as a two-letter ISO country code, or the country name in lower_snake_case.",
parameters={
"provider": "imf",
"symbol": "RAFA_USD,RAPFA_USD,RAFA_RAPFA_RO",
"country": "us,china,jp,4f,gb",
"start_date": "2010-01-01",
"end_date": "2020-12-31",
"frequency": "annual",
},
),
],
)
async def indicators(
Expand Down
Loading
Loading