Files
OpenBB/website/content/api/etf/weights/_index.md
Colin Delahunty 0b33cb45f8 Adds auto yaml generation (#2587)
* Began working on docs creator

* Added fixes

* More

* More

* Adding autogen_try.py for OpenBB API doc generation

* OpenBB API docs gen try

* Fixed

* Added fixes

* Added fixes

* subs -> sub

* Updated docs

* Updated docs

Co-authored-by: Chavithra PARANA <chavithra@gmail.com>
2022-09-23 16:43:34 +01:00

990 B
Vendored

To obtain charts, make sure to add chart=True as the last parameter

Get underlying data

etf.weights(name: str) -> Dict

Return sector weightings allocation of ETF. [Source: Yahoo Finance]

Parameters
----------
name: str
    ETF name

Returns
----------
Dict
    Dictionary with sector weightings allocation

Getting charts

etf.weights(name: str, raw: bool = False, min_pct_to_display: float = 5, export: str = '', external_axes: Optional[List[matplotlib.axes._axes.Axes]] = None, chart=True)

Display sector weightings allocation of ETF. [Source: Yahoo Finance]

Parameters
----------
name: str
    ETF name
raw: bool
    Display sector weighting allocation
min_pct_to_display: float
    Minimum percentage to display sector
export: str
    Type of format to export data
external_axes : Optional[List[plt.Axes]], optional
    External axes (1 axis is expected in the list), by default None