Files
OpenBB/openbb_platform/openbb/package/currency.py
montezdesousa 7deb4e69f6 [Feature] - Comma separated string and list inputs (#6062)
* feat: balancesheet

* feat: income statement

* fix: cash flow statement

* feat: financial ratios

* feat: reported financials

* feat: revenue business line

* feat: revenue per geography

* fix: warnings

* Update balance_sheet.py

* fix: remove warning imports

* feat: balance sheet growth

* feat: calendar ipo

* feat: cashflow growth

* feat: __validators__

* fix: typing

* fix: validator msg

* feat: trailing dividend_yield

* feat: short volume

* feat: share statistics

* feat: price target + consensus

* fix: update validator

* feat: historical dividends

* feat: key executives

* fix: getattr directly

* fix: type hint validator

* fix: add default to getattr

* typo

* feat: otc

* feat: options chains

* fix: remove list validators

* feat: add validator dict to fetchers

* lint

* update standard models

* lint

* feat: rename validator

* fix: ownership

* feat: query params description

* fix: balance yfinance

* key execs, income statement

* remove change

* fix: revenue geographic

* fix: disable pylint

* fix: unusual + balance

* unit test validator

* minor fix

* explicit validators

* update test

* feat: multiple items allowed

* rebuild

* move check_single_value

* crypto historical

* order providers

* fix typing

* rename extra dict

* marking multiple items allowed

* Revert "marking multiple items allowed"

This reverts commit 7da04817e1.

* error msg

* fix: default provider runtime vs configuration

* minor fix

* docstring

* revert default changes

* get provider before executing cmd

* fix container bug

* clean filter

* add comment

* prevent bad defaults

* update docstring

* typing

* fix

* black

* fix docstring generation

* [Feature] - Mark multiple item fetchers (#6074)

* feat: price target

* bezinga company news

* equity quote

* marking multiple items allowed

* more multiple items

* black

* rebuild

* another batch

* rebuild

* another

* cpi

* move prop

* rebuild

---------

Co-authored-by: hjoaquim <h.joaquim@campus.fct.unl.pt>

* rename var

* update msg

* rename func

* fix test

* mypy

* ruff

---------

Co-authored-by: hjoaquim <h.joaquim@campus.fct.unl.pt>
2024-02-15 12:19:18 +00:00

139 lines
5.9 KiB
Python

### THIS FILE IS AUTO-GENERATED. DO NOT EDIT. ###
from typing import Literal, Optional
from openbb_core.app.model.obbject import OBBject
from openbb_core.app.static.container import Container
from openbb_core.app.static.utils.decorators import validate
from openbb_core.app.static.utils.filters import filter_inputs
class ROUTER_currency(Container):
"""/currency
/price
search
"""
def __repr__(self) -> str:
return self.__doc__ or ""
@property
def price(self):
# pylint: disable=import-outside-toplevel
from . import currency_price
return currency_price.ROUTER_currency_price(command_runner=self._command_runner)
@validate
def search(
self, provider: Optional[Literal["fmp", "intrinio", "polygon"]] = None, **kwargs
) -> OBBject:
"""
Currency Search.
Search available currency pairs.
Currency pairs are the national currencies from two countries coupled for trading on
the foreign exchange (FX) marketplace.
Both currencies will have exchange rates on which the trade will have its position basis.
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
----------
provider : Optional[Literal['fmp', 'intrinio', 'polygon']]
The provider to use for the query, by default None.
If None, the provider specified in defaults is selected or 'fmp' if there is
no default.
symbol : Optional[str]
Symbol of the pair to search. (provider: polygon)
date : Optional[datetime.date]
A specific date to get data for. (provider: polygon)
search : Optional[str]
Search for terms within the ticker and/or company name. (provider: polygon)
active : Optional[bool]
Specify if the tickers returned should be actively traded on the queried date. (provider: polygon)
order : Optional[Literal['asc', 'desc']]
Order data by ascending or descending. (provider: polygon)
sort : Optional[Literal['ticker', 'name', 'market', 'locale', 'currency_symbol', 'currency_name', 'base_currency_symbol', 'base_currency_name', 'last_updated_utc', 'delisted_utc']]
Sort field used for ordering. (provider: polygon)
limit : Optional[Annotated[int, Gt(gt=0)]]
The number of data entries to return. (provider: polygon)
Returns
-------
OBBject
results : List[CurrencyPairs]
Serializable results.
provider : Optional[Literal['fmp', 'intrinio', 'polygon']]
Provider name.
warnings : Optional[List[Warning_]]
List of warnings.
chart : Optional[Chart]
Chart object.
extra: Dict[str, Any]
Extra info.
CurrencyPairs
-------------
name : str
Name of the currency pair.
symbol : Optional[str]
Symbol of the currency pair. (provider: fmp)
currency : Optional[str]
Base currency of the currency pair. (provider: fmp)
stock_exchange : Optional[str]
Stock exchange of the currency pair. (provider: fmp)
exchange_short_name : Optional[str]
Short name of the stock exchange of the currency pair. (provider: fmp)
code : Optional[str]
Code of the currency pair. (provider: intrinio)
base_currency : Optional[str]
ISO 4217 currency code of the base currency. (provider: intrinio)
quote_currency : Optional[str]
ISO 4217 currency code of the quote currency. (provider: intrinio)
market : Optional[str]
Name of the trading market. Always 'fx'. (provider: polygon)
locale : Optional[str]
Locale of the currency pair. (provider: polygon)
currency_symbol : Optional[str]
The symbol of the quote currency. (provider: polygon)
currency_name : Optional[str]
Name of the quote currency. (provider: polygon)
base_currency_symbol : Optional[str]
The symbol of the base currency. (provider: polygon)
base_currency_name : Optional[str]
Name of the base currency. (provider: polygon)
last_updated_utc : Optional[datetime]
The last updated timestamp in UTC. (provider: polygon)
delisted_utc : Optional[datetime]
The delisted timestamp in UTC. (provider: polygon)
Example
-------
>>> from openbb import obb
>>> obb.currency.search()
>>> # Search for 'EURUSD' currency pair using 'polygon' as provider.
>>> obb.currency.search(provider='polygon', symbol='EURUSD')
>>> # Search for terms using 'polygon' as provider.
>>> obb.currency.search(provider='polygon', search='Euro zone')
>>> # Search for actively traded currency pairs on the queried date using 'polygon' as provider.
>>> obb.currency.search(provider='polygon', date='2024-01-02', active=True)
""" # noqa: E501
return self._run(
"/currency/search",
**filter_inputs(
provider_choices={
"provider": self._get_provider(
provider,
"/currency/search",
("fmp", "intrinio", "polygon"),
)
},
standard_params={},
extra_params=kwargs,
)
)