mirror of
https://github.com/OpenBB-finance/OpenBB.git
synced 2026-11-01 23:12:21 +00:00
better website docs
This commit is contained in:
@@ -30,6 +30,23 @@ The OBBject (OpenBB Object) is at the heart of developing around the OpenBB Plat
|
||||
- Extra
|
||||
- Additional metadata about the command run, including any arguments, the route, the timestamp, etc.
|
||||
|
||||
Additionally, the OBBject class contains a class variable, `accessors`, which is used to register extensions to the class. This is done by using the `@obbject_accessor` decorator. This decorator will register the class as an accessor to the OBBject class, and will be available on every OBBject returned by a command.
|
||||
|
||||
```python
|
||||
|
||||
from openbb import obb
|
||||
res = obb.equity.price.historical("AAPL")
|
||||
res.accessors
|
||||
```
|
||||
|
||||
An example with the `openbb-charting` extension would output:
|
||||
|
||||
```console
|
||||
{'charting'}
|
||||
```
|
||||
|
||||
> Find more about `OBBject` extensions [here](/website/content/platform/development/developer-guidelines/obbject_extensions.md).
|
||||
|
||||
## Example
|
||||
|
||||
In the python interface, the OBBject class is returned by every command. The following example shows how to access the results of a command:
|
||||
@@ -130,6 +147,6 @@ Returns numpy arrays of the results. Note that this loses the column names, so y
|
||||
|
||||
Growing in popularity, polars is a blazingly fast dataframe library. This method will return a polars dataframe. Note that we do not include polars in the core dependency tree, so it needs to be installed separately.
|
||||
|
||||
---
|
||||
#### show()
|
||||
|
||||
More information can be found on the [OpenBB Core Readme](https://github.com/OpenBB-finance/OpenBBTerminal/blob/develop/openbb_platform/core/README.md)
|
||||
This method will display the chart if it was computed during the execution of the command, by setting the `chart` parameter to `True`.
|
||||
|
||||
@@ -42,17 +42,13 @@ The sections below outline any specific installation considerations for the exte
|
||||
|
||||
The OpenBB Charting Extension supplies charting infrastructure and services to the OpenBB Platform. Figure objects are served via REST API or Python Client. It utilizes [PyWry](https://github.com/OpenBB-finance/pywry) for handling the display of interactive charts and tables in a separate window, with a Plotly library. The extension framework allows developers to easily insert other Python charting libraries into the router pipeline.
|
||||
|
||||
Functions with charting enabled return figures to a field (`chart`) in the `OBBject` response object. They are displayed with the class method, `show()`. Additional Python libraries are installed with this extension:
|
||||
Functions with charting enabled return figures to a field (`chart`) in the `OBBject` response object. They are displayed with the class method, `show()`.
|
||||
|
||||
- aiohttp
|
||||
- nbformat
|
||||
- pandas-ta
|
||||
- plotly
|
||||
- pywry
|
||||
- reportlab
|
||||
- scipy
|
||||
- statsmodels
|
||||
- svglib
|
||||
> Additional Python libraries are installed with this extension: `aiohttp`, `nbformat`, `pandas-ta`, `plotly`, `pywry`, `reportlab`, `scipy`, `statsmodels`, and `svglib`.
|
||||
|
||||
:::tip
|
||||
The `openbb-charting` is in fact an [`OBBject` extension](/website/content/platform/development/developer-guidelines/obbject_extensions.md) which means you'll have the functionality it exposes on every command result.
|
||||
:::
|
||||
|
||||
### Installation
|
||||
|
||||
@@ -62,6 +58,8 @@ To install the extension, run the following command in this folder:
|
||||
pip install openbb-charting
|
||||
```
|
||||
|
||||
> Find the latest version on [PyPI](https://pypi.org/project/openbb-charting/).
|
||||
|
||||
To install from source in editable mode, navigate into the folder, `~/openbb_platform/extensions/charting`, and enter:
|
||||
|
||||
```console
|
||||
|
||||
Reference in New Issue
Block a user