Skip to content

Commit

Permalink
static files
Browse files Browse the repository at this point in the history
  • Loading branch information
deeleeramone committed Oct 8, 2024
1 parent b985f62 commit 3b02961
Show file tree
Hide file tree
Showing 34 changed files with 6,316 additions and 1,746 deletions.
2 changes: 1 addition & 1 deletion openbb_platform/openbb/assets/reference.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"info": {
"title": "OpenBB Platform (Python)",
"description": "Investment research for everyone, anywhere.",
"core": "1.3.3",
"core": "1.3.4",
"extensions": {
"openbb_core_extension": [
"commodity@1.2.3",
Expand Down
4 changes: 3 additions & 1 deletion openbb_platform/openbb/package/commodity.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,6 @@ def price(self):
# pylint: disable=import-outside-toplevel
from . import commodity_price

return commodity_price.ROUTER_commodity_price(command_runner=self._command_runner)
return commodity_price.ROUTER_commodity_price(
command_runner=self._command_runner
)
92 changes: 83 additions & 9 deletions openbb_platform/openbb/package/commodity_price.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,20 @@ def __repr__(self) -> str:
@validate
def spot(
self,
start_date: Annotated[Union[datetime.date, None, str], OpenBBField(description="Start date of the data, in YYYY-MM-DD format.")] = None,
end_date: Annotated[Union[datetime.date, None, str], OpenBBField(description="End date of the data, in YYYY-MM-DD format.")] = None,
provider: Annotated[Optional[Literal["fred"]], OpenBBField(description="The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: fred.")] = None,
start_date: Annotated[
Union[datetime.date, None, str],
OpenBBField(description="Start date of the data, in YYYY-MM-DD format."),
] = None,
end_date: Annotated[
Union[datetime.date, None, str],
OpenBBField(description="End date of the data, in YYYY-MM-DD format."),
] = None,
provider: Annotated[
Optional[Literal["fred"]],
OpenBBField(
description="The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: fred."
),
] = None,
**kwargs
) -> OBBject:
"""Commodity Spot Prices.
Expand Down Expand Up @@ -95,15 +106,15 @@ def spot(
CommoditySpotPrices
-------------------
date : date
The date of the data.
The date of the data.
symbol : Optional[str]
Symbol representing the entity requested in the data.
Symbol representing the entity requested in the data.
commodity : Optional[str]
Commodity name.
Commodity name.
price : float
Price of the commodity.
Price of the commodity.
unit : Optional[str]
Unit of the commodity price.
Unit of the commodity price.
Examples
--------
Expand All @@ -127,6 +138,69 @@ def spot(
"end_date": end_date,
},
extra_params=kwargs,
info={"commodity": {"fred": {"multiple_items_allowed": False, "choices": ["wti", "brent", "natural_gas", "jet_fuel", "propane", "heating_oil", "diesel_gulf_coast", "diesel_ny_harbor", "diesel_la", "gasoline_ny_harbor", "gasoline_gulf_coast", "rbob", "all"]}}, "frequency": {"fred": {"multiple_items_allowed": False, "choices": ["a", "q", "m", "w", "d", "wef", "weth", "wew", "wetu", "wem", "wesu", "wesa", "bwew", "bwem"]}}, "aggregation_method": {"fred": {"multiple_items_allowed": False, "choices": ["avg", "sum", "eop"]}}, "transform": {"fred": {"multiple_items_allowed": False, "choices": ["chg", "ch1", "pch", "pc1", "pca", "cch", "cca", "log"]}}},
info={
"commodity": {
"fred": {
"multiple_items_allowed": False,
"choices": [
"wti",
"brent",
"natural_gas",
"jet_fuel",
"propane",
"heating_oil",
"diesel_gulf_coast",
"diesel_ny_harbor",
"diesel_la",
"gasoline_ny_harbor",
"gasoline_gulf_coast",
"rbob",
"all",
],
}
},
"frequency": {
"fred": {
"multiple_items_allowed": False,
"choices": [
"a",
"q",
"m",
"w",
"d",
"wef",
"weth",
"wew",
"wetu",
"wem",
"wesu",
"wesa",
"bwew",
"bwem",
],
}
},
"aggregation_method": {
"fred": {
"multiple_items_allowed": False,
"choices": ["avg", "sum", "eop"],
}
},
"transform": {
"fred": {
"multiple_items_allowed": False,
"choices": [
"chg",
"ch1",
"pch",
"pc1",
"pca",
"cch",
"cca",
"log",
],
}
},
},
)
)
15 changes: 11 additions & 4 deletions openbb_platform/openbb/package/crypto.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,15 @@ def price(self):
@validate
def search(
self,
query: Annotated[Optional[str], OpenBBField(description="Search query.")] = None,
provider: Annotated[Optional[Literal["fmp"]], OpenBBField(description="The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: fmp.")] = None,
query: Annotated[
Optional[str], OpenBBField(description="Search query.")
] = None,
provider: Annotated[
Optional[Literal["fmp"]],
OpenBBField(
description="The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: fmp."
),
] = None,
**kwargs
) -> OBBject:
"""Search available cryptocurrency pairs within a provider.
Expand Down Expand Up @@ -60,9 +67,9 @@ def search(
CryptoSearch
------------
symbol : str
Symbol representing the entity requested in the data. (Crypto)
Symbol representing the entity requested in the data. (Crypto)
name : Optional[str]
Name of the crypto.
Name of the crypto.
currency : Optional[str]
The currency the crypto trades for. (provider: fmp)
exchange : Optional[str]
Expand Down
75 changes: 63 additions & 12 deletions openbb_platform/openbb/package/crypto_price.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,26 @@ def __repr__(self) -> str:
@validate
def historical(
self,
symbol: Annotated[Union[str, List[str]], OpenBBField(description="Symbol to get data for. Can use CURR1-CURR2 or CURR1CURR2 format. Multiple comma separated items allowed for provider(s): fmp, polygon, tiingo, yfinance.")],
start_date: Annotated[Union[datetime.date, None, str], OpenBBField(description="Start date of the data, in YYYY-MM-DD format.")] = None,
end_date: Annotated[Union[datetime.date, None, str], OpenBBField(description="End date of the data, in YYYY-MM-DD format.")] = None,
provider: Annotated[Optional[Literal["fmp", "polygon", "tiingo", "yfinance"]], OpenBBField(description="The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: fmp, polygon, tiingo, yfinance.")] = None,
symbol: Annotated[
Union[str, List[str]],
OpenBBField(
description="Symbol to get data for. Can use CURR1-CURR2 or CURR1CURR2 format. Multiple comma separated items allowed for provider(s): fmp, polygon, tiingo, yfinance."
),
],
start_date: Annotated[
Union[datetime.date, None, str],
OpenBBField(description="Start date of the data, in YYYY-MM-DD format."),
] = None,
end_date: Annotated[
Union[datetime.date, None, str],
OpenBBField(description="End date of the data, in YYYY-MM-DD format."),
] = None,
provider: Annotated[
Optional[Literal["fmp", "polygon", "tiingo", "yfinance"]],
OpenBBField(
description="The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: fmp, polygon, tiingo, yfinance."
),
] = None,
**kwargs
) -> OBBject:
"""Get historical price data for cryptocurrency pair(s) within a provider.
Expand Down Expand Up @@ -67,19 +83,19 @@ def historical(
CryptoHistorical
----------------
date : Union[date, datetime]
The date of the data.
The date of the data.
open : float
The open price.
The open price.
high : float
The high price.
The high price.
low : float
The low price.
The low price.
close : float
The close price.
The close price.
volume : float
The trading volume.
The trading volume.
vwap : Optional[Annotated[float, Gt(gt=0)]]
Volume Weighted Average Price over the period.
Volume Weighted Average Price over the period.
adj_close : Optional[float]
The adjusted close price. (provider: fmp)
change : Optional[float]
Expand Down Expand Up @@ -117,6 +133,41 @@ def historical(
"end_date": end_date,
},
extra_params=kwargs,
info={"symbol": {"fmp": {"multiple_items_allowed": True, "choices": None}, "polygon": {"multiple_items_allowed": True, "choices": None}, "tiingo": {"multiple_items_allowed": True, "choices": None}, "yfinance": {"multiple_items_allowed": True, "choices": None}}, "interval": {"fmp": {"multiple_items_allowed": False, "choices": ["1m", "5m", "15m", "30m", "1h", "4h", "1d"]}, "tiingo": {"multiple_items_allowed": False, "choices": ["1m", "5m", "15m", "30m", "1h", "4h", "1d"]}, "yfinance": {"multiple_items_allowed": False, "choices": ["1m", "2m", "5m", "15m", "30m", "60m", "90m", "1h", "1d", "5d", "1W", "1M", "1Q"]}}},
info={
"symbol": {
"fmp": {"multiple_items_allowed": True, "choices": None},
"polygon": {"multiple_items_allowed": True, "choices": None},
"tiingo": {"multiple_items_allowed": True, "choices": None},
"yfinance": {"multiple_items_allowed": True, "choices": None},
},
"interval": {
"fmp": {
"multiple_items_allowed": False,
"choices": ["1m", "5m", "15m", "30m", "1h", "4h", "1d"],
},
"tiingo": {
"multiple_items_allowed": False,
"choices": ["1m", "5m", "15m", "30m", "1h", "4h", "1d"],
},
"yfinance": {
"multiple_items_allowed": False,
"choices": [
"1m",
"2m",
"5m",
"15m",
"30m",
"60m",
"90m",
"1h",
"1d",
"5d",
"1W",
"1M",
"1Q",
],
},
},
},
)
)
71 changes: 52 additions & 19 deletions openbb_platform/openbb/package/currency.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,16 @@ def price(self):
@validate
def search(
self,
query: Annotated[Optional[str], OpenBBField(description="Query to search for currency pairs.")] = None,
provider: Annotated[Optional[Literal["fmp", "intrinio", "polygon"]], OpenBBField(description="The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: fmp, intrinio, polygon.")] = None,
query: Annotated[
Optional[str],
OpenBBField(description="Query to search for currency pairs."),
] = None,
provider: Annotated[
Optional[Literal["fmp", "intrinio", "polygon"]],
OpenBBField(
description="The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: fmp, intrinio, polygon."
),
] = None,
**kwargs
) -> OBBject:
"""Currency Search.
Expand All @@ -44,7 +52,7 @@ def search(
All trading within the forex market, whether selling, buying, or trading, will take place through currency pairs.
(ref: Investopedia)
Major currency pairs include pairs such as EUR/USD, USD/JPY, GBP/USD, etc.
Parameters
----------
Expand All @@ -70,9 +78,9 @@ def search(
CurrencyPairs
-------------
symbol : str
Symbol representing the entity requested in the data.
Symbol representing the entity requested in the data.
name : Optional[str]
Name of the currency pair.
Name of the currency pair.
currency : Optional[str]
Base currency of the currency pair. (provider: fmp)
stock_exchange : Optional[str]
Expand Down Expand Up @@ -129,10 +137,30 @@ def search(
@validate
def snapshots(
self,
base: Annotated[Union[str, List[str]], OpenBBField(description="The base currency symbol. Multiple comma separated items allowed for provider(s): fmp, polygon.")] = "usd",
quote_type: Annotated[Literal["direct", "indirect"], OpenBBField(description="Whether the quote is direct or indirect. Selecting 'direct' will return the exchange rate as the amount of domestic currency required to buy one unit of the foreign currency. Selecting 'indirect' (default) will return the exchange rate as the amount of foreign currency required to buy one unit of the domestic currency.")] = "indirect",
counter_currencies: Annotated[Union[List[str], str, None], OpenBBField(description="An optional list of counter currency symbols to filter for. None returns all.")] = None,
provider: Annotated[Optional[Literal["fmp", "polygon"]], OpenBBField(description="The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: fmp, polygon.")] = None,
base: Annotated[
Union[str, List[str]],
OpenBBField(
description="The base currency symbol. Multiple comma separated items allowed for provider(s): fmp, polygon."
),
] = "usd",
quote_type: Annotated[
Literal["direct", "indirect"],
OpenBBField(
description="Whether the quote is direct or indirect. Selecting 'direct' will return the exchange rate as the amount of domestic currency required to buy one unit of the foreign currency. Selecting 'indirect' (default) will return the exchange rate as the amount of foreign currency required to buy one unit of the domestic currency."
),
] = "indirect",
counter_currencies: Annotated[
Union[List[str], str, None],
OpenBBField(
description="An optional list of counter currency symbols to filter for. None returns all."
),
] = None,
provider: Annotated[
Optional[Literal["fmp", "polygon"]],
OpenBBField(
description="The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: fmp, polygon."
),
] = None,
**kwargs
) -> OBBject:
"""Snapshots of currency exchange rates from an indirect or direct perspective of a base currency.
Expand Down Expand Up @@ -165,23 +193,23 @@ def snapshots(
CurrencySnapshots
-----------------
base_currency : str
The base, or domestic, currency.
The base, or domestic, currency.
counter_currency : str
The counter, or foreign, currency.
The counter, or foreign, currency.
last_rate : float
The exchange rate, relative to the base currency. Rates are expressed as the amount of foreign currency received from selling one unit of the base currency, or the quantity of foreign currency required to purchase one unit of the domestic currency. To inverse the perspective, set the 'quote_type' parameter as 'direct'.
The exchange rate, relative to the base currency. Rates are expressed as the amount of foreign currency received from selling one unit of the base currency, or the quantity of foreign currency required to purchase one unit of the domestic currency. To inverse the perspective, set the 'quote_type' parameter as 'direct'.
open : Optional[float]
The open price.
The open price.
high : Optional[float]
The high price.
The high price.
low : Optional[float]
The low price.
The low price.
close : Optional[float]
The close price.
The close price.
volume : Optional[int]
The trading volume.
The trading volume.
prev_close : Optional[float]
The previous close price.
The previous close price.
change : Optional[float]
The change in the price from the previous close. (provider: fmp, polygon)
change_percent : Optional[float]
Expand Down Expand Up @@ -258,6 +286,11 @@ def snapshots(
"counter_currencies": counter_currencies,
},
extra_params=kwargs,
info={"base": {"fmp": {"multiple_items_allowed": True, "choices": None}, "polygon": {"multiple_items_allowed": True, "choices": None}}},
info={
"base": {
"fmp": {"multiple_items_allowed": True, "choices": None},
"polygon": {"multiple_items_allowed": True, "choices": None},
}
},
)
)
Loading

0 comments on commit 3b02961

Please sign in to comment.