* add some charts PR stuff into the main repo * add charting method working for jupyter * dont raise * renamed router * cleaner * ruff * remove print, add todo * minor readme adjustment on url * adding pandas-ta * add pandas-ta to deps * remove optional content * settings env file * Use import relative to the package instead of REPO * using openbb_directory const instead * optional content * optional content * optional content * black * added user styles for console * initializing backend in the charting manager and moving things - working version * pyling * add defaults * ruff * fixing circular import * fix backend creation * cmd location on the args instead * considering charting settings on ta class * cleaning ta extension * adding missing dependency on ta * charts on window * misplaced import * rename file no_import to dummy_backend * redirect import * introducing debug_mode and cleaning todos on ta_class * rename backend folder to core * move charts inside app folder and allocate models * move logs folder into app folder * fixing paths * fixing todos on openbb_figure * setting dummy backend to warn and open in browser if pywry missing * ruff * write msg inside exception * refactor the use of the theme * change package builder module names * removing all references to theme as global variable * ajudsting the usage of kwargs on the charting_router * removing references to rich style and console things * dinamically import the backend functions on the charting manager * add comment * fix backend funcs import * read debug_mode from env * no need to fix manager, but ignore ruff inside __init__ * break command_runner __execute_func into smaller functions * don't raise unless debug mode * replace some errors by OpenBBError * raise provider error if failure * add timedelta minus 7 for eods * 5 is better * print chart error if any * same print for warnings * fixing the broken indicators and removing clutter * warn warnings in debug mode * fix path * fixes on the ta examples * bringing back the utils functions * add error handling messages and sync debug mode * rename base_filter to call_filter * fix chart on api * complete comment * add runtime debug_mode in the static version * removing comment * working with dataframes in the package * ruff * ruff * ruff * readme * ruff --------- Co-authored-by: hjoaquim <h.joaquim@campus.fct.unl.pt>
1.6 KiB
Vendored
OpenBB Charting extension
This extension provides a charting library for OpenBB SDK.
The library includes:
- charting infrastructure based on Plotly and
- a set of charting components
- prebuilt charts for a set of commands that are available in built-in OpenBB SDK extensions
Installation
To install the extension, run the following command in this folder:
pip install .
PyWry dependency on Linux
The PyWry dependency handles display of interactive charts and tables in a separate window. It is installed automatically with the OpenBB Charting extension.
When using linux distributions, the PyWry dependency requires certain dependencies to be installed first.
Debian-based / Ubuntu / Mint:
sudo apt install libwebkit2gtk-4.0-dev
Arch Linux / Manjaro:
sudo pacman -S webkit2gtk
Fedora:
sudo dnf install gtk3-devel webkit2gtk3-devel
Usage
To use the extension is as simple as running any of the OpenBB SDK endpoints with the chart argument equals to True.
Here's an example how it would look like in a python interface:
from openbb import obb
stock_data = obb.stocks.load(symbol="TSLA", start_date="2023-01-01", provider="fmp", chart=True)
Which would result in an CommandOutput object containing a chart attribute, which contains plotly json data.
In order to actually display the chart, you need to call the show() method.
stock_data.show()
Note: The
show()method is only going to work either in a Jupyter Notebook or in a standalone python script where a PyWry based backend is properly initialized.