mirror of
https://github.com/OpenBB-finance/OpenBB.git
synced 2026-11-02 23:41:27 +00:00
create dict by alias
This commit is contained in:
@@ -77,7 +77,7 @@ class FMPForexEODFetcher(
|
||||
api_key = credentials.get("fmp_api_key") if credentials else ""
|
||||
|
||||
base_url = "https://financialmodelingprep.com/api/v3"
|
||||
query_str = get_querystring(query.dict(), ["symbol"])
|
||||
query_str = get_querystring(query.dict(by_alias=True), ["symbol"])
|
||||
query_str = query_str.replace("start_date", "from").replace("end_date", "to")
|
||||
url = f"{base_url}/historical-price-full/forex/{query.symbol}?{query_str}&apikey={api_key}"
|
||||
|
||||
|
||||
@@ -82,7 +82,7 @@ class FMPMajorIndicesEODFetcher(
|
||||
api_key = credentials.get("fmp_api_key") if credentials else ""
|
||||
|
||||
base_url = "https://financialmodelingprep.com/api/v3"
|
||||
query_str = get_querystring(query.dict(), ["symbol"])
|
||||
query_str = get_querystring(query.dict(by_alias=True), ["symbol"])
|
||||
query_str = query_str.replace("start_date", "from").replace("end_date", "to")
|
||||
url = f"{base_url}/historical-price-full/index/%5E{query.symbol}?{query_str}&apikey={api_key}"
|
||||
|
||||
|
||||
@@ -79,7 +79,7 @@ class FMPStockEODFetcher(
|
||||
api_key = credentials.get("fmp_api_key") if credentials else ""
|
||||
|
||||
base_url = "https://financialmodelingprep.com/api/v3"
|
||||
query_str = get_querystring(query.dict(), ["symbol"])
|
||||
query_str = get_querystring(query.dict(by_alias=True), ["symbol"])
|
||||
query_str = query_str.replace("start_date", "from").replace("end_date", "to")
|
||||
url = f"{base_url}/historical-price-full/{query.symbol}?{query_str}&apikey={api_key}"
|
||||
|
||||
|
||||
@@ -69,7 +69,7 @@ class FMPTreasuryRatesFetcher(
|
||||
api_key = credentials.get("fmp_api_key") if credentials else ""
|
||||
|
||||
base_url = "https://financialmodelingprep.com/api/v4/"
|
||||
query_str = get_querystring(query.dict(), [])
|
||||
query_str = get_querystring(query.dict(by_alias=True), [])
|
||||
query_str = query_str.replace("start_date", "from").replace("end_date", "to")
|
||||
url = f"{base_url}treasury?{query_str}&apikey={api_key}"
|
||||
return get_data_many(url, FMPTreasuryRatesData)
|
||||
|
||||
@@ -69,7 +69,7 @@ def create_url(
|
||||
The querystring.
|
||||
|
||||
"""
|
||||
the_dict = {} if not query else query.dict()
|
||||
the_dict = {} if not query else query.dict(by_alias=True)
|
||||
query_string = get_querystring(the_dict, exclude or [])
|
||||
base_url = f"https://financialmodelingprep.com/api/v{version}/"
|
||||
return f"{base_url}{endpoint}?{query_string}&apikey={api_key}"
|
||||
|
||||
@@ -59,7 +59,7 @@ class PolygonBalanceSheetFetcher(
|
||||
api_key = credentials.get("polygon_api_key") if credentials else ""
|
||||
|
||||
base_url = "https://api.polygon.io/vX/reference/financials"
|
||||
query_string = get_querystring(query.dict(), [])
|
||||
query_string = get_querystring(query.dict(by_alias=True), [])
|
||||
request_url = f"{base_url}?{query_string}&apiKey={api_key}"
|
||||
data = get_data(request_url)["results"]
|
||||
|
||||
|
||||
@@ -65,7 +65,7 @@ class PolygonCashFlowStatementFetcher(
|
||||
api_key = credentials.get("polygon_api_key") if credentials else ""
|
||||
|
||||
base_url = "https://api.polygon.io/vX/reference/financials"
|
||||
query_string = get_querystring(query.dict(), [])
|
||||
query_string = get_querystring(query.dict(by_alias=True), [])
|
||||
request_url = f"{base_url}?{query_string}&apiKey={api_key}"
|
||||
data = get_data(request_url)["results"]
|
||||
|
||||
|
||||
@@ -76,7 +76,7 @@ class PolygonIncomeStatementFetcher(
|
||||
api_key = credentials.get("polygon_api_key") if credentials else ""
|
||||
|
||||
base_url = "https://api.polygon.io/vX/reference/financials"
|
||||
query_string = get_querystring(query.dict(), [])
|
||||
query_string = get_querystring(query.dict(by_alias=True), [])
|
||||
request_url = f"{base_url}?{query_string}&apiKey={api_key}"
|
||||
data = get_data(request_url)["results"]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user