mirror of
https://github.com/OpenBB-finance/OpenBB.git
synced 2026-12-01 13:44:16 +00:00
relative imports package_builder
This commit is contained in:
@@ -22,54 +22,54 @@ class Extensions(Container):
|
||||
|
||||
@property
|
||||
def crypto(self): # route = "/crypto"
|
||||
from openbb.package import crypto
|
||||
from . import crypto
|
||||
|
||||
return crypto.CLASS_crypto(command_runner=self._command_runner)
|
||||
|
||||
@property
|
||||
def economy(self): # route = "/economy"
|
||||
from openbb.package import economy
|
||||
from . import economy
|
||||
|
||||
return economy.CLASS_economy(command_runner=self._command_runner)
|
||||
|
||||
@property
|
||||
def fixedincome(self): # route = "/fixedincome"
|
||||
from openbb.package import fixedincome
|
||||
from . import fixedincome
|
||||
|
||||
return fixedincome.CLASS_fixedincome(command_runner=self._command_runner)
|
||||
|
||||
@property
|
||||
def forex(self): # route = "/forex"
|
||||
from openbb.package import forex
|
||||
from . import forex
|
||||
|
||||
return forex.CLASS_forex(command_runner=self._command_runner)
|
||||
|
||||
@property
|
||||
def futures(self): # route = "/futures"
|
||||
from openbb.package import futures
|
||||
from . import futures
|
||||
|
||||
return futures.CLASS_futures(command_runner=self._command_runner)
|
||||
|
||||
@property
|
||||
def news(self): # route = "/news"
|
||||
from openbb.package import news
|
||||
from . import news
|
||||
|
||||
return news.CLASS_news(command_runner=self._command_runner)
|
||||
|
||||
@property
|
||||
def qa(self): # route = "/qa"
|
||||
from openbb.package import qa
|
||||
from . import qa
|
||||
|
||||
return qa.CLASS_qa(command_runner=self._command_runner)
|
||||
|
||||
@property
|
||||
def stocks(self): # route = "/stocks"
|
||||
from openbb.package import stocks
|
||||
from . import stocks
|
||||
|
||||
return stocks.CLASS_stocks(command_runner=self._command_runner)
|
||||
|
||||
@property
|
||||
def ta(self): # route = "/ta"
|
||||
from openbb.package import ta
|
||||
from . import ta
|
||||
|
||||
return ta.CLASS_ta(command_runner=self._command_runner)
|
||||
|
||||
@@ -42,7 +42,7 @@ class CLASS_crypto(Container):
|
||||
provider: Optional[Literal["fmp", "polygon", "yfinance"]] = None,
|
||||
**kwargs
|
||||
) -> OBBject[List]:
|
||||
r"""Crypto EOD Price.
|
||||
"""Crypto EOD Price.
|
||||
|
||||
Parameters
|
||||
----------
|
||||
@@ -118,11 +118,11 @@ class CLASS_crypto(Container):
|
||||
change : Optional[float]
|
||||
Change in the price of the symbol from the previous day. (provider: fmp)
|
||||
change_percent : Optional[float]
|
||||
Change \% in the price of the symbol. (provider: fmp)
|
||||
Change \\% in the price of the symbol. (provider: fmp)
|
||||
label : Optional[str]
|
||||
Human readable format of the date. (provider: fmp)
|
||||
change_over_time : Optional[float]
|
||||
Change \% in the price of the symbol over a period of time. (provider: fmp)
|
||||
Change \\% in the price of the symbol over a period of time. (provider: fmp)
|
||||
n : Optional[PositiveInt]
|
||||
Number of transactions for the symbol in the time period. (provider: polygon)
|
||||
""" # noqa: E501
|
||||
|
||||
@@ -674,7 +674,7 @@ class CLASS_economy(Container):
|
||||
provider: Optional[Literal["fmp", "polygon", "yfinance"]] = None,
|
||||
**kwargs
|
||||
) -> OBBject[List]:
|
||||
r"""Get OHLCV data for an index.
|
||||
"""Get OHLCV data for an index.
|
||||
|
||||
Parameters
|
||||
----------
|
||||
@@ -750,11 +750,11 @@ class CLASS_economy(Container):
|
||||
change : Optional[float]
|
||||
Change in the price of the symbol from the previous day. (provider: fmp)
|
||||
change_percent : Optional[float]
|
||||
Change \% in the price of the symbol. (provider: fmp)
|
||||
Change \\% in the price of the symbol. (provider: fmp)
|
||||
label : Optional[str]
|
||||
Human readable format of the date. (provider: fmp)
|
||||
change_over_time : Optional[float]
|
||||
Change \% in the price of the symbol over a period of time. (provider: fmp)
|
||||
Change \\% in the price of the symbol over a period of time. (provider: fmp)
|
||||
n : Optional[PositiveInt]
|
||||
Number of transactions for the symbol in the time period. (provider: polygon)
|
||||
""" # noqa: E501
|
||||
|
||||
@@ -43,7 +43,7 @@ class CLASS_forex(Container):
|
||||
provider: Optional[Literal["fmp", "polygon", "yfinance"]] = None,
|
||||
**kwargs
|
||||
) -> OBBject[List]:
|
||||
r"""Forex Intraday Price.
|
||||
"""Forex Intraday Price.
|
||||
|
||||
Parameters
|
||||
----------
|
||||
@@ -117,11 +117,11 @@ class CLASS_forex(Container):
|
||||
change : Optional[float]
|
||||
Change in the price of the symbol from the previous day. (provider: fmp)
|
||||
change_percent : Optional[float]
|
||||
Change \% in the price of the symbol. (provider: fmp)
|
||||
Change \\% in the price of the symbol. (provider: fmp)
|
||||
label : Optional[str]
|
||||
Human readable format of the date. (provider: fmp)
|
||||
change_over_time : Optional[float]
|
||||
Change \% in the price of the symbol over a period of time. (provider: fmp)
|
||||
Change \\% in the price of the symbol over a period of time. (provider: fmp)
|
||||
n : Optional[PositiveInt]
|
||||
Number of transactions for the symbol in the time period. (provider: polygon)
|
||||
""" # noqa: E501
|
||||
|
||||
@@ -38,37 +38,37 @@ class CLASS_stocks(Container):
|
||||
|
||||
@property
|
||||
def ca(self): # route = "/stocks/ca"
|
||||
from openbb.package import stocks_ca
|
||||
from . import stocks_ca
|
||||
|
||||
return stocks_ca.CLASS_stocks_ca(command_runner=self._command_runner)
|
||||
|
||||
@property
|
||||
def dd(self): # route = "/stocks/dd"
|
||||
from openbb.package import stocks_dd
|
||||
from . import stocks_dd
|
||||
|
||||
return stocks_dd.CLASS_stocks_dd(command_runner=self._command_runner)
|
||||
|
||||
@property
|
||||
def disc(self): # route = "/stocks/disc"
|
||||
from openbb.package import stocks_disc
|
||||
from . import stocks_disc
|
||||
|
||||
return stocks_disc.CLASS_stocks_disc(command_runner=self._command_runner)
|
||||
|
||||
@property
|
||||
def dps(self): # route = "/stocks/dps"
|
||||
from openbb.package import stocks_dps
|
||||
from . import stocks_dps
|
||||
|
||||
return stocks_dps.CLASS_stocks_dps(command_runner=self._command_runner)
|
||||
|
||||
@property
|
||||
def fa(self): # route = "/stocks/fa"
|
||||
from openbb.package import stocks_fa
|
||||
from . import stocks_fa
|
||||
|
||||
return stocks_fa.CLASS_stocks_fa(command_runner=self._command_runner)
|
||||
|
||||
@property
|
||||
def gov(self): # route = "/stocks/gov"
|
||||
from openbb.package import stocks_gov
|
||||
from . import stocks_gov
|
||||
|
||||
return stocks_gov.CLASS_stocks_gov(command_runner=self._command_runner)
|
||||
|
||||
@@ -191,7 +191,7 @@ class CLASS_stocks(Container):
|
||||
|
||||
@property
|
||||
def ins(self): # route = "/stocks/ins"
|
||||
from openbb.package import stocks_ins
|
||||
from . import stocks_ins
|
||||
|
||||
return stocks_ins.CLASS_stocks_ins(command_runner=self._command_runner)
|
||||
|
||||
@@ -218,7 +218,7 @@ class CLASS_stocks(Container):
|
||||
provider: Optional[Literal["cboe", "fmp", "polygon", "yfinance"]] = None,
|
||||
**kwargs
|
||||
) -> OBBject[List]:
|
||||
r"""Load stock data for a specific ticker.
|
||||
"""Load stock data for a specific ticker.
|
||||
|
||||
Parameters
|
||||
----------
|
||||
@@ -294,11 +294,11 @@ class CLASS_stocks(Container):
|
||||
change : Optional[float]
|
||||
Change in the price of the symbol from the previous day. (provider: fmp)
|
||||
change_percent : Optional[float]
|
||||
Change \% in the price of the symbol. (provider: fmp)
|
||||
Change \\% in the price of the symbol. (provider: fmp)
|
||||
label : Optional[str]
|
||||
Human readable format of the date. (provider: fmp)
|
||||
change_over_time : Optional[float]
|
||||
Change \% in the price of the symbol over a period of time. (provider: fmp)
|
||||
Change \\% in the price of the symbol over a period of time. (provider: fmp)
|
||||
n : Optional[PositiveInt]
|
||||
Number of transactions for the symbol in the time period. (provider: polygon)
|
||||
""" # noqa: E501
|
||||
@@ -663,7 +663,7 @@ class CLASS_stocks(Container):
|
||||
|
||||
@property
|
||||
def options(self): # route = "/stocks/options"
|
||||
from openbb.package import stocks_options
|
||||
from . import stocks_options
|
||||
|
||||
return stocks_options.CLASS_stocks_options(command_runner=self._command_runner)
|
||||
|
||||
|
||||
@@ -406,7 +406,7 @@ class MethodDefinition:
|
||||
|
||||
code = "\n @property\n"
|
||||
code += f' def {function_name}(self): # route = "{path}"\n'
|
||||
code += f" from openbb.package import {module_name}\n"
|
||||
code += f" from . import {module_name}\n"
|
||||
code += f" return {module_name}.{class_name}(command_runner=self._command_runner)\n"
|
||||
|
||||
return code
|
||||
|
||||
Reference in New Issue
Block a user