Many improvements to the documentation (#3562)

* Many improvements

* Forgot these

* Set menus correctly

* Delete unrelated code

* Add in chart styling

* Add in simple guide to chart styling

* More updates

* last changes

* Update changing-sources.md

* Update file to redirect to proper folder and formatting

Co-authored-by: Jeroen Bouma <jeroenbouma@Jeroens-MacBook-Pro.local>
Co-authored-by: Jeroen Bouma <jeroenbouma@jeroens-mbp.home>
This commit is contained in:
Jeroen Bouma
2022-11-25 19:10:28 +01:00
committed by GitHub
parent 0a41d6787e
commit 6316d36be1
16 changed files with 409 additions and 1216 deletions

View File

@@ -1,5 +1,6 @@
---
title: Changing Sources
sidebar_position: 1
---
Some functions have the built-in capability of requesting data from multiple sources. `obb.stocks.load` is one example of this type feature:
@@ -25,7 +26,7 @@ obb.stocks.load(
| 2022-11-15 15:45:00 | 399.114 | 399.13 | 397.46 | 398.53 | 398.53 | 6.46879e+06 |
| 2022-11-15 16:00:00 | 398.54 | 399.06 | 395.01 | 398.175 | 398.175 | 1.99462e+06 |
The choices for the `source` are currently:
The choices for `source` within this functionality are:
- YahooFinance (default)
- IEXCloud
@@ -33,32 +34,12 @@ The choices for the `source` are currently:
- Polygon
- EODHD
Each source may have unique arguments, consult the docstrings for specific details. If the command syntax is not framed as a variable assignment, results are printed as a table. When assigned to a variable, the table is not displayed.
Note that for each function, the variable can have sources that are not described as above. As an example, `openbb.stocks.fa.income` has the following sources:
There are functions which return a Tuple, and they can be identified through the docstrings. It will also be evident when the returned data is not presented as a DataFrame. The list, highlighted in the right frame of the image below, provides guidance for unpacking the results.
- Polygon
- YahooFinance
- AlphaVantage
- FinancialModelingPrep
- EODHD
![Tuples](https://user-images.githubusercontent.com/85772166/201582221-8203a240-aa74-4755-989d-8cac167e40c6.png "Tuples")
The two elements within this Tuple are a DataFrame, and a String. Variables are assigned in the order described by the docstrings.
```python
data,title = obb.crypto.dd.mt(symbol = 'ETH', timeseries_id = 'act.addr.cnt', start_date = '2019-01-01')
```
Data need not be collected by the OpenBB SDK in order for it to be passed through the functions. Local files can be read with Pandas functions such as, `pd.read_csv()`. Importing an additional module, `pandas_datareader`, is a low-code method for requesting data from alternate sources.
```python
import pandas_datareader as pdr
spx_daily = pdr.get_data_stooq('^SPX', start = '1990-11-11')
spx_daily.tail(5)
```
| Date | Open | High | Low | Close | Volume |
| :------------------ | -----: | -----: | -----: | -----: | ----------: |
| 1990-11-16 00:00:00 | 317.02 | 318.8 | 314.99 | 317.12 | 9.19111e+07 |
| 1990-11-15 00:00:00 | 320.4 | 320.4 | 316.13 | 317.02 | 8.40944e+07 |
| 1990-11-14 00:00:00 | 317.66 | 321.7 | 317.23 | 320.4 | 9.96167e+07 |
| 1990-11-13 00:00:00 | 319.48 | 319.48 | 317.26 | 317.67 | 8.90222e+07 |
| 1990-11-12 00:00:00 | 313.74 | 319.77 | 313.73 | 319.48 | 8.96611e+07 |
Also note that some sources allow you to use certain variables while other do not. For example, `YahooFinance` doesn't provide you with quarterly data whereas `AlphaVantage` does. Therefore, `quarterly=True` can not be used in combination with `source=YahooFinance`.

View File

@@ -0,0 +1,22 @@
---
title: Adjusting Chart Style
sidebar_position: 2
---
Within the OpenBB SDK, you can customize your chart style. You can switch between `dark` and `light` easily using this block of code:
```python
from openbb_terminal.sdk import TerminalStyle
theme = TerminalStyle("light", "light", "light")
```
<img width="813" alt="Screenshot 2022-10-03 at 23 56 52" src="https://user-images.githubusercontent.com/40023817/193700307-cbb12edc-0a5d-4804-9f3c-a798efd9e69d.png">
OR
```python
from openbb_terminal.sdk import TerminalStyle
theme = TerminalStyle("dark", "dark", "dark")
```
<img width="791" alt="Screenshot 2022-10-03 at 23 46 33" src="https://user-images.githubusercontent.com/40023817/193699221-e154995b-653c-40fd-8fc6-a3f8d39638db.png">

View File

@@ -1,879 +0,0 @@
---
title: User Settings
---
## **The OpenBBUserData Folder**
The OpenBB SDK shares the `OpenBBUserData` folder with the Terminal, even with multiple versions installed on the same machine. Portfolio files, screener presets, and Matplotlib style sheets are all shared resources. This folder will be created after the first installation and it is read by subsequent installations. The default location for it is in the root of the operating system user account folder.
### Presets
For screeners, it is not necessary to include the full path to the preset file. The example below is for the stock screener, with the preset, `unusual_volume.ini`.
```python
results = []
results = openbb.stocks.screener.screener_data(
preset_loaded = 'unusual_volume.ini',
data_type = 'technical',
limit = 5,
)
results = results.sort_values(ascending = False, by = ['Volume'])
results.head(5)
```
| | Ticker | Beta | ATR | SMA20 | SMA50 | SMA200 | 52W High | 52W Low | RSI | Price | Change | from Open | Gap | Volume |
| --: | :----- | ---: | ----: | ------: | ------: | ------: | -------: | ------: | ----: | -----: | ------: | --------: | ------: | ----------: |
| 48 | CUEN | 0.61 | 0.04 | -0.0367 | -0.2802 | -0.5626 | -0.8793 | 0.1505 | 39.65 | 0.35 | 0.0494 | -0.2249 | 0.3539 | 1.15487e+07 |
| 16 | PDSB | 2.54 | 0.55 | 0.6788 | 1.0466 | 0.7899 | -0.248 | 2.0104 | 83.52 | 8.7 | 0.2323 | 0.1951 | 0.0312 | 6.32774e+06 |
| 32 | IBTE | nan | 0.05 | 0.0025 | -0.0015 | -0.0214 | -0.0661 | 0.0076 | 53.72 | 23.89 | 0.0008 | 0.0004 | 0.0004 | 5.85758e+06 |
| 11 | PTLO | nan | 1.28 | 0.033 | 0.038 | 0.0368 | -0.6097 | 0.5187 | 52.02 | 22.53 | -0.0941 | -0.004 | -0.0905 | 3.96768e+06 |
| 65 | ABMD | 1.32 | 10.78 | 0.1822 | 0.3316 | 0.3296 | -0.0201 | 0.7027 | 78.79 | 374.32 | 0.0006 | -0.0006 | 0.0011 | 3.50787e+06 |
This will fetch results from the options screener with the preset, `Highest_OI`:
```python
results = []
results, title = openbb.stocks.options.screen.screener_output(preset='Highest_OI.ini')
pd.DataFrame(results.head(5))
```
| | Contract Symbol | Expiration | Ticker | Type | Strike | Vol | OI | IV | Delta | Gamma | Rho | Theta | Vega | Last Traded | Bid | Ask | Last | % Change | Underlying | P/B |
| --: | :----------------- | :--------- | :----- | :--- | -----: | ----: | -----: | --------: | ----------: | ----------: | ----------: | -----------: | ----------: | :---------- | --: | --: | ---: | -------: | ---------: | -------: |
| 0 | SLV230120C00035000 | 2023-01-20 | SLV | C | 35 | 338 | 389212 | 0.250008 | 2.65844e-09 | 8.21107e-09 | 8.20159e-11 | -2.63722e-10 | 1.23914e-09 | 2022-11-18 | 0 | 0 | 0.02 | 0 | 19.25 | 0.901724 |
| 1 | EEM221216C00045000 | 2022-12-16 | EEM | C | 45 | 14086 | 341301 | 0.125009 | 1.13015e-07 | 4.91845e-07 | 2.86473e-09 | -1.52641e-08 | 5.96183e-08 | 2022-11-18 | 0 | 0 | 0.02 | 0 | 38.03 | 0.723568 |
| 2 | SLV230120C00040000 | 2023-01-20 | SLV | C | 40 | 200 | 316800 | 0.500005 | 0.000228694 | 0.000221098 | 6.8245e-06 | -2.83253e-05 | 6.67309e-05 | 2022-11-18 | 0 | 0 | 0.01 | 0 | 19.25 | 0.901724 |
| 3 | NOK230120C00007000 | 2023-01-20 | NOK | C | 7 | 557 | 257115 | 0.250008 | 0.00010857 | 0.000884296 | 8.27629e-07 | -1.74568e-06 | 8.2688e-06 | 2022-11-18 | 0 | 0 | 0.01 | 0 | 4.79 | 1.36273 |
| 4 | EEM221216C00040000 | 2022-12-16 | EEM | C | 40 | 13302 | 247105 | 0.0625094 | 0.000969793 | 0.00531776 | 2.46164e-05 | -4.14814e-05 | 0.000322318 | 2022-11-18 | 0 | 0 | 0.23 | 0 | 38.03 | 0.723568 |
### Portfolio Files
User files are located in, `~/OpenBBUserData/portfolio/holdings/`, and can be loaded like:
```python
port = openbb.portfolio.load(transactions_file_path='/users/username/OpenBBUserData/portfolio/holdings/test_port.csv')
```
```console
Preprocessing transactions: 100%|██████████| 14/14 [00:01<00:00, 7.20it/s]
Loading price data: 100%|██████████| 1/1 [00:00<00:00, 2.09it/s]
Calculating returns: 100%|██████████| 1/1 [00:00<00:00, 30.04it/s]
Loading benchmark: 100%|██████████| 4/4 [00:04<00:00, 1.15s/it]
```
```python
openbb.portfolio.show(port)
```
| | Date | Type | Ticker | Side | Price | Quantity | Fees | Investment | Currency | Sector | Industry | Country | Region |
| --: | :--------- | :---- | :------ | :--- | ----: | -------: | ---: | ---------: | :------- | :----------------- | :--------------- | :------------ | :------------ |
| 5 | 2021-11-04 | STOCK | ABX.TO | Buy | 23.46 | 1000 | 200 | 23660 | CAD | Basic Materials | Gold | Canada | North America |
| 4 | 2021-11-04 | STOCK | PHYS.TO | Buy | 17.57 | 1400 | 200 | 24798 | CAD | Financial Services | Asset Management | Canada | North America |
| 1 | 2021-10-29 | STOCK | WPM.TO | Buy | 51.23 | 300 | 200 | 15569 | CAD | Basic Materials | Gold | Canada | North America |
| 3 | 2021-10-29 | STOCK | K.TO | Buy | 7.93 | 1900 | 200 | 15267 | CAD | Basic Materials | Gold | Canada | North America |
| 2 | 2021-10-29 | STOCK | NGT.TO | Buy | 71.05 | 200 | 200 | 14410 | CAD | Basic Materials | Gold | United States | North America |
| 0 | 2021-10-27 | STOCK | PHYS.TO | Buy | 17.65 | 3000 | 200 | 53150 | CAD | Financial Services | Asset Management | Canada | North America |
### Importing Previously Exported Files
The best way to load a local `csv` or `xlsx` file to memory is with Pandas Read:
```python
data = pd.read_csv('/Users/user/OpenBBUserData/exports/20221106_SPY.csv')
```
If necessary, clean the data before passing through the desired function.
### Matplotlib Style Sheets
Pasted below is the default Matplotlib, `mplrc`, style sheet. Use this as a reference for making changes to the style sheets located in the `OpenBBUserData/styles/user` folder.
```
#### MATPLOTLIBRC FORMAT
## NOTE FOR END USERS: DO NOT EDIT THIS FILE!
##
## This is a sample Matplotlib configuration file - you can find a copy
## of it on your system in site-packages/matplotlib/mpl-data/matplotlibrc
## (relative to your Python installation location).
## DO NOT EDIT IT!
##
## If you wish to change your default style, copy this file to one of the
## following locations:
## Unix/Linux:
## $HOME/.config/matplotlib/matplotlibrc OR
## $XDG_CONFIG_HOME/matplotlib/matplotlibrc (if $XDG_CONFIG_HOME is set)
## Other platforms:
## $HOME/.matplotlib/matplotlibrc
## and edit that copy.
##
## See https://matplotlib.org/stable/tutorials/introductory/customizing.html#customizing-with-matplotlibrc-files
## for more details on the paths which are checked for the configuration file.
##
## Blank lines, or lines starting with a comment symbol, are ignored, as are
## trailing comments. Other lines must have the format:
## key: val # optional comment
##
## Formatting: Use PEP8-like style (as enforced in the rest of the codebase).
## All lines start with an additional '#', so that removing all leading '#'s
## yields a valid style file.
##
## Colors: for the color values below, you can either use
## - a Matplotlib color string, such as r, k, or b
## - an RGB tuple, such as (1.0, 0.5, 0.0)
## - a double-quoted hex string, such as "#ff00ff".
## The unquoted string ff00ff is also supported for backward
## compatibility, but is discouraged.
## - a scalar grayscale intensity such as 0.75
## - a legal html color name, e.g., red, blue, darkslategray
##
## String values may optionally be enclosed in double quotes, which allows
## using the comment character # in the string.
##
## This file (and other style files) must be encoded as utf-8.
##
## Matplotlib configuration are currently divided into following parts:
## - BACKENDS
## - LINES
## - PATCHES
## - HATCHES
## - BOXPLOT
## - FONT
## - TEXT
## - LaTeX
## - AXES
## - DATES
## - TICKS
## - GRIDS
## - LEGEND
## - FIGURE
## - IMAGES
## - CONTOUR PLOTS
## - ERRORBAR PLOTS
## - HISTOGRAM PLOTS
## - SCATTER PLOTS
## - AGG RENDERING
## - PATHS
## - SAVING FIGURES
## - INTERACTIVE KEYMAPS
## - ANIMATION
##### CONFIGURATION BEGINS HERE
## ***************************************************************************
## * BACKENDS *
## ***************************************************************************
## The default backend. If you omit this parameter, the first working
## backend from the following list is used:
## MacOSX QtAgg Gtk4Agg Gtk3Agg TkAgg WxAgg Agg
## Other choices include:
## QtCairo GTK4Cairo GTK3Cairo TkCairo WxCairo Cairo
## Qt5Agg Qt5Cairo Wx # deprecated.
## PS PDF SVG Template
## You can also deploy your own backend outside of Matplotlib by referring to
## the module name (which must be in the PYTHONPATH) as 'module://my_backend'.
##backend: Agg
## The port to use for the web server in the WebAgg backend.
#webagg.port: 8988
## The address on which the WebAgg web server should be reachable
#webagg.address: 127.0.0.1
## If webagg.port is unavailable, a number of other random ports will
## be tried until one that is available is found.
#webagg.port_retries: 50
## When True, open the web browser to the plot that is shown
#webagg.open_in_browser: True
## If you are running pyplot inside a GUI and your backend choice
## conflicts, we will automatically try to find a compatible one for
## you if backend_fallback is True
#backend_fallback: True
#interactive: False
#toolbar: toolbar2 # {None, toolbar2, toolmanager}
#timezone: UTC # a pytz timezone string, e.g., US/Central or Europe/Paris
## ***************************************************************************
## * LINES *
## ***************************************************************************
## See https://matplotlib.org/api/artist_api.html#module-matplotlib.lines
## for more information on line properties.
#lines.linewidth: 1.5 # line width in points
#lines.linestyle: - # solid line
#lines.color: C0 # has no affect on plot(); see axes.prop_cycle
#lines.marker: None # the default marker
#lines.markerfacecolor: auto # the default marker face color
#lines.markeredgecolor: auto # the default marker edge color
#lines.markeredgewidth: 1.0 # the line width around the marker symbol
#lines.markersize: 6 # marker size, in points
#lines.dash_joinstyle: round # {miter, round, bevel}
#lines.dash_capstyle: butt # {butt, round, projecting}
#lines.solid_joinstyle: round # {miter, round, bevel}
#lines.solid_capstyle: projecting # {butt, round, projecting}
#lines.antialiased: True # render lines in antialiased (no jaggies)
## The three standard dash patterns. These are scaled by the linewidth.
#lines.dashed_pattern: 3.7, 1.6
#lines.dashdot_pattern: 6.4, 1.6, 1, 1.6
#lines.dotted_pattern: 1, 1.65
#lines.scale_dashes: True
#markers.fillstyle: full # {full, left, right, bottom, top, none}
#pcolor.shading: auto
#pcolormesh.snap: True # Whether to snap the mesh to pixel boundaries. This is
# provided solely to allow old test images to remain
# unchanged. Set to False to obtain the previous behavior.
## ***************************************************************************
## * PATCHES *
## ***************************************************************************
## Patches are graphical objects that fill 2D space, like polygons or circles.
## See https://matplotlib.org/api/artist_api.html#module-matplotlib.patches
## for more information on patch properties.
#patch.linewidth: 1.0 # edge width in points.
#patch.facecolor: C0
#patch.edgecolor: black # if forced, or patch is not filled
#patch.force_edgecolor: False # True to always use edgecolor
#patch.antialiased: True # render patches in antialiased (no jaggies)
## ***************************************************************************
## * HATCHES *
## ***************************************************************************
#hatch.color: black
#hatch.linewidth: 1.0
## ***************************************************************************
## * BOXPLOT *
## ***************************************************************************
#boxplot.notch: False
#boxplot.vertical: True
#boxplot.whiskers: 1.5
#boxplot.bootstrap: None
#boxplot.patchartist: False
#boxplot.showmeans: False
#boxplot.showcaps: True
#boxplot.showbox: True
#boxplot.showfliers: True
#boxplot.meanline: False
#boxplot.flierprops.color: black
#boxplot.flierprops.marker: o
#boxplot.flierprops.markerfacecolor: none
#boxplot.flierprops.markeredgecolor: black
#boxplot.flierprops.markeredgewidth: 1.0
#boxplot.flierprops.markersize: 6
#boxplot.flierprops.linestyle: none
#boxplot.flierprops.linewidth: 1.0
#boxplot.boxprops.color: black
#boxplot.boxprops.linewidth: 1.0
#boxplot.boxprops.linestyle: -
#boxplot.whiskerprops.color: black
#boxplot.whiskerprops.linewidth: 1.0
#boxplot.whiskerprops.linestyle: -
#boxplot.capprops.color: black
#boxplot.capprops.linewidth: 1.0
#boxplot.capprops.linestyle: -
#boxplot.medianprops.color: C1
#boxplot.medianprops.linewidth: 1.0
#boxplot.medianprops.linestyle: -
#boxplot.meanprops.color: C2
#boxplot.meanprops.marker: ^
#boxplot.meanprops.markerfacecolor: C2
#boxplot.meanprops.markeredgecolor: C2
#boxplot.meanprops.markersize: 6
#boxplot.meanprops.linestyle: --
#boxplot.meanprops.linewidth: 1.0
## ***************************************************************************
## * FONT *
## ***************************************************************************
## The font properties used by `text.Text`.
## See https://matplotlib.org/api/font_manager_api.html for more information
## on font properties. The 6 font properties used for font matching are
## given below with their default values.
##
## The font.family property can take either a single or multiple entries of any
## combination of concrete font names (not supported when rendering text with
## usetex) or the following five generic values:
## - 'serif' (e.g., Times),
## - 'sans-serif' (e.g., Helvetica),
## - 'cursive' (e.g., Zapf-Chancery),
## - 'fantasy' (e.g., Western), and
## - 'monospace' (e.g., Courier).
## Each of these values has a corresponding default list of font names
## (font.serif, etc.); the first available font in the list is used. Note that
## for font.serif, font.sans-serif, and font.monospace, the first element of
## the list (a DejaVu font) will always be used because DejaVu is shipped with
## Matplotlib and is thus guaranteed to be available; the other entries are
## left as examples of other possible values.
##
## The font.style property has three values: normal (or roman), italic
## or oblique. The oblique style will be used for italic, if it is not
## present.
##
## The font.variant property has two values: normal or small-caps. For
## TrueType fonts, which are scalable fonts, small-caps is equivalent
## to using a font size of 'smaller', or about 83%% of the current font
## size.
##
## The font.weight property has effectively 13 values: normal, bold,
## bolder, lighter, 100, 200, 300, ..., 900. Normal is the same as
## 400, and bold is 700. bolder and lighter are relative values with
## respect to the current weight.
##
## The font.stretch property has 11 values: ultra-condensed,
## extra-condensed, condensed, semi-condensed, normal, semi-expanded,
## expanded, extra-expanded, ultra-expanded, wider, and narrower. This
## property is not currently implemented.
##
## The font.size property is the default font size for text, given in points.
## 10 pt is the standard value.
##
## Note that font.size controls default text sizes. To configure
## special text sizes tick labels, axes, labels, title, etc., see the rc
## settings for axes and ticks. Special text sizes can be defined
## relative to font.size, using the following values: xx-small, x-small,
## small, medium, large, x-large, xx-large, larger, or smaller
#font.family: sans-serif
#font.style: normal
#font.variant: normal
#font.weight: normal
#font.stretch: normal
#font.size: 10.0
#font.serif: DejaVu Serif, Bitstream Vera Serif, Computer Modern Roman, New Century Schoolbook, Century Schoolbook L, Utopia, ITC Bookman, Bookman, Nimbus Roman No9 L, Times New Roman, Times, Palatino, Charter, serif
#font.sans-serif: DejaVu Sans, Bitstream Vera Sans, Computer Modern Sans Serif, Lucida Grande, Verdana, Geneva, Lucid, Arial, Helvetica, Avant Garde, sans-serif
#font.cursive: Apple Chancery, Textile, Zapf Chancery, Sand, Script MT, Felipa, Comic Neue, Comic Sans MS, cursive
#font.fantasy: Chicago, Charcoal, Impact, Western, Humor Sans, xkcd, fantasy
#font.monospace: DejaVu Sans Mono, Bitstream Vera Sans Mono, Computer Modern Typewriter, Andale Mono, Nimbus Mono L, Courier New, Courier, Fixed, Terminal, monospace
## ***************************************************************************
## * TEXT *
## ***************************************************************************
## The text properties used by `text.Text`.
## See https://matplotlib.org/api/artist_api.html#module-matplotlib.text
## for more information on text properties
#text.color: black
## FreeType hinting flag ("foo" corresponds to FT_LOAD_FOO); may be one of the
## following (Proprietary Matplotlib-specific synonyms are given in parentheses,
## but their use is discouraged):
## - default: Use the font's native hinter if possible, else FreeType's auto-hinter.
## ("either" is a synonym).
## - no_autohint: Use the font's native hinter if possible, else don't hint.
## ("native" is a synonym.)
## - force_autohint: Use FreeType's auto-hinter. ("auto" is a synonym.)
## - no_hinting: Disable hinting. ("none" is a synonym.)
#text.hinting: force_autohint
#text.hinting_factor: 8 # Specifies the amount of softness for hinting in the
# horizontal direction. A value of 1 will hint to full
# pixels. A value of 2 will hint to half pixels etc.
#text.kerning_factor: 0 # Specifies the scaling factor for kerning values. This
# is provided solely to allow old test images to remain
# unchanged. Set to 6 to obtain previous behavior.
# Values other than 0 or 6 have no defined meaning.
#text.antialiased: True # If True (default), the text will be antialiased.
# This only affects raster outputs.
#text.parse_math: True # Use mathtext if there is an even number of unescaped
# dollar signs.
## ***************************************************************************
## * LaTeX *
## ***************************************************************************
## For more information on LaTeX properties, see
## https://matplotlib.org/tutorials/text/usetex.html
#text.usetex: False # use latex for all text handling. The following fonts
# are supported through the usual rc parameter settings:
# new century schoolbook, bookman, times, palatino,
# zapf chancery, charter, serif, sans-serif, helvetica,
# avant garde, courier, monospace, computer modern roman,
# computer modern sans serif, computer modern typewriter
#text.latex.preamble: # IMPROPER USE OF THIS FEATURE WILL LEAD TO LATEX FAILURES
# AND IS THEREFORE UNSUPPORTED. PLEASE DO NOT ASK FOR HELP
# IF THIS FEATURE DOES NOT DO WHAT YOU EXPECT IT TO.
# text.latex.preamble is a single line of LaTeX code that
# will be passed on to the LaTeX system. It may contain
# any code that is valid for the LaTeX "preamble", i.e.
# between the "\documentclass" and "\begin{document}"
# statements.
# Note that it has to be put on a single line, which may
# become quite long.
# The following packages are always loaded with usetex,
# so beware of package collisions:
# geometry, inputenc, type1cm.
# PostScript (PSNFSS) font packages may also be
# loaded, depending on your font settings.
## The following settings allow you to select the fonts in math mode.
#mathtext.fontset: dejavusans # Should be 'dejavusans' (default),
# 'dejavuserif', 'cm' (Computer Modern), 'stix',
# 'stixsans' or 'custom' (unsupported, may go
# away in the future)
## "mathtext.fontset: custom" is defined by the mathtext.bf, .cal, .it, ...
## settings which map a TeX font name to a fontconfig font pattern. (These
## settings are not used for other font sets.)
#mathtext.bf: sans:bold
#mathtext.cal: cursive
#mathtext.it: sans:italic
#mathtext.rm: sans
#mathtext.sf: sans
#mathtext.tt: monospace
#mathtext.fallback: cm # Select fallback font from ['cm' (Computer Modern), 'stix'
# 'stixsans'] when a symbol can not be found in one of the
# custom math fonts. Select 'None' to not perform fallback
# and replace the missing character by a dummy symbol.
#mathtext.default: it # The default font to use for math.
# Can be any of the LaTeX font names, including
# the special name "regular" for the same font
# used in regular text.
## ***************************************************************************
## * AXES *
## ***************************************************************************
## Following are default face and edge colors, default tick sizes,
## default font sizes for tick labels, and so on. See
## https://matplotlib.org/api/axes_api.html#module-matplotlib.axes
#axes.facecolor: white # axes background color
#axes.edgecolor: black # axes edge color
#axes.linewidth: 0.8 # edge line width
#axes.grid: False # display grid or not
#axes.grid.axis: both # which axis the grid should apply to
#axes.grid.which: major # grid lines at {major, minor, both} ticks
#axes.titlelocation: center # alignment of the title: {left, right, center}
#axes.titlesize: large # font size of the axes title
#axes.titleweight: normal # font weight of title
#axes.titlecolor: auto # color of the axes title, auto falls back to
# text.color as default value
#axes.titley: None # position title (axes relative units). None implies auto
#axes.titlepad: 6.0 # pad between axes and title in points
#axes.labelsize: medium # font size of the x and y labels
#axes.labelpad: 4.0 # space between label and axis
#axes.labelweight: normal # weight of the x and y labels
#axes.labelcolor: black
#axes.axisbelow: line # draw axis gridlines and ticks:
# - below patches (True)
# - above patches but below lines ('line')
# - above all (False)
#axes.formatter.limits: -5, 6 # use scientific notation if log10
# of the axis range is smaller than the
# first or larger than the second
#axes.formatter.use_locale: False # When True, format tick labels
# according to the user's locale.
# For example, use ',' as a decimal
# separator in the fr_FR locale.
#axes.formatter.use_mathtext: False # When True, use mathtext for scientific
# notation.
#axes.formatter.min_exponent: 0 # minimum exponent to format in scientific notation
#axes.formatter.useoffset: True # If True, the tick label formatter
# will default to labeling ticks relative
# to an offset when the data range is
# small compared to the minimum absolute
# value of the data.
#axes.formatter.offset_threshold: 4 # When useoffset is True, the offset
# will be used when it can remove
# at least this number of significant
# digits from tick labels.
#axes.spines.left: True # display axis spines
#axes.spines.bottom: True
#axes.spines.top: True
#axes.spines.right: True
#axes.unicode_minus: True # use Unicode for the minus symbol rather than hyphen. See
# https://en.wikipedia.org/wiki/Plus_and_minus_signs#Character_codes
#axes.prop_cycle: cycler('color', ['1f77b4', 'ff7f0e', '2ca02c', 'd62728', '9467bd', '8c564b', 'e377c2', '7f7f7f', 'bcbd22', '17becf'])
# color cycle for plot lines as list of string color specs:
# single letter, long name, or web-style hex
# As opposed to all other parameters in this file, the color
# values must be enclosed in quotes for this parameter,
# e.g. '1f77b4', instead of 1f77b4.
# See also https://matplotlib.org/tutorials/intermediate/color_cycle.html
# for more details on prop_cycle usage.
#axes.xmargin: .05 # x margin. See `axes.Axes.margins`
#axes.ymargin: .05 # y margin. See `axes.Axes.margins`
#axes.zmargin: .05 # z margin. See `axes.Axes.margins`
#axes.autolimit_mode: data # If "data", use axes.xmargin and axes.ymargin as is.
# If "round_numbers", after application of margins, axis
# limits are further expanded to the nearest "round" number.
#polaraxes.grid: True # display grid on polar axes
#axes3d.grid: True # display grid on 3D axes
## ***************************************************************************
## * AXIS *
## ***************************************************************************
#xaxis.labellocation: center # alignment of the xaxis label: {left, right, center}
#yaxis.labellocation: center # alignment of the yaxis label: {bottom, top, center}
## ***************************************************************************
## * DATES *
## ***************************************************************************
## These control the default format strings used in AutoDateFormatter.
## Any valid format datetime format string can be used (see the python
## `datetime` for details). For example, by using:
## - '%%x' will use the locale date representation
## - '%%X' will use the locale time representation
## - '%%c' will use the full locale datetime representation
## These values map to the scales:
## {'year': 365, 'month': 30, 'day': 1, 'hour': 1/24, 'minute': 1 / (24 * 60)}
#date.autoformatter.year: %Y
#date.autoformatter.month: %Y-%m
#date.autoformatter.day: %Y-%m-%d
#date.autoformatter.hour: %m-%d %H
#date.autoformatter.minute: %d %H:%M
#date.autoformatter.second: %H:%M:%S
#date.autoformatter.microsecond: %M:%S.%f
## The reference date for Matplotlib's internal date representation
## See https://matplotlib.org/examples/ticks_and_spines/date_precision_and_epochs.py
#date.epoch: 1970-01-01T00:00:00
## 'auto', 'concise':
#date.converter: auto
## For auto converter whether to use interval_multiples:
#date.interval_multiples: True
## ***************************************************************************
## * TICKS *
## ***************************************************************************
## See https://matplotlib.org/api/axis_api.html#matplotlib.axis.Tick
#xtick.top: False # draw ticks on the top side
#xtick.bottom: True # draw ticks on the bottom side
#xtick.labeltop: False # draw label on the top
#xtick.labelbottom: True # draw label on the bottom
#xtick.major.size: 3.5 # major tick size in points
#xtick.minor.size: 2 # minor tick size in points
#xtick.major.width: 0.8 # major tick width in points
#xtick.minor.width: 0.6 # minor tick width in points
#xtick.major.pad: 3.5 # distance to major tick label in points
#xtick.minor.pad: 3.4 # distance to the minor tick label in points
#xtick.color: black # color of the ticks
#xtick.labelcolor: inherit # color of the tick labels or inherit from xtick.color
#xtick.labelsize: medium # font size of the tick labels
#xtick.direction: out # direction: {in, out, input}
#xtick.minor.visible: False # visibility of minor ticks on x-axis
#xtick.major.top: True # draw x axis top major ticks
#xtick.major.bottom: True # draw x axis bottom major ticks
#xtick.minor.top: True # draw x axis top minor ticks
#xtick.minor.bottom: True # draw x axis bottom minor ticks
#xtick.alignment: center # alignment of xticks
#ytick.left: True # draw ticks on the left side
#ytick.right: False # draw ticks on the right side
#ytick.labelleft: True # draw tick labels on the left side
#ytick.labelright: False # draw tick labels on the right side
#ytick.major.size: 3.5 # major tick size in points
#ytick.minor.size: 2 # minor tick size in points
#ytick.major.width: 0.8 # major tick width in points
#ytick.minor.width: 0.6 # minor tick width in points
#ytick.major.pad: 3.5 # distance to major tick label in points
#ytick.minor.pad: 3.4 # distance to the minor tick label in points
#ytick.color: black # color of the ticks
#ytick.labelcolor: inherit # color of the tick labels or inherit from ytick.color
#ytick.labelsize: medium # font size of the tick labels
#ytick.direction: out # direction: {in, out, input}
#ytick.minor.visible: False # visibility of minor ticks on y-axis
#ytick.major.left: True # draw y axis left major ticks
#ytick.major.right: True # draw y axis right major ticks
#ytick.minor.left: True # draw y axis left minor ticks
#ytick.minor.right: True # draw y axis right minor ticks
#ytick.alignment: center_baseline # alignment of yticks
## ***************************************************************************
## * GRIDS *
## ***************************************************************************
#grid.color: "#b0b0b0" # grid color
#grid.linestyle: - # solid
#grid.linewidth: 0.8 # in points
#grid.alpha: 1.0 # transparency, between 0.0 and 1.0
## ***************************************************************************
## * LEGEND *
## ***************************************************************************
#legend.loc: best
#legend.frameon: True # if True, draw the legend on a background patch
#legend.framealpha: 0.8 # legend patch transparency
#legend.facecolor: inherit # inherit from axes.facecolor; or color spec
#legend.edgecolor: 0.8 # background patch boundary color
#legend.fancybox: True # if True, use a rounded box for the
# legend background, else a rectangle
#legend.shadow: False # if True, give background a shadow effect
#legend.numpoints: 1 # the number of marker points in the legend line
#legend.scatterpoints: 1 # number of scatter points
#legend.markerscale: 1.0 # the relative size of legend markers vs. original
#legend.fontsize: medium
#legend.labelcolor: None
#legend.title_fontsize: None # None sets to the same as the default axes.
## Dimensions as fraction of font size:
#legend.borderpad: 0.4 # border whitespace
#legend.labelspacing: 0.5 # the vertical space between the legend entries
#legend.handlelength: 2.0 # the length of the legend lines
#legend.handleheight: 0.7 # the height of the legend handle
#legend.handletextpad: 0.8 # the space between the legend line and legend text
#legend.borderaxespad: 0.5 # the border between the axes and legend edge
#legend.columnspacing: 2.0 # column separation
## ***************************************************************************
## * FIGURE *
## ***************************************************************************
## See https://matplotlib.org/api/figure_api.html#matplotlib.figure.Figure
#figure.titlesize: large # size of the figure title (``Figure.suptitle()``)
#figure.titleweight: normal # weight of the figure title
#figure.labelsize: large # size of the figure label (``Figure.sup[x|y]label()``)
#figure.labelweight: normal # weight of the figure label
#figure.figsize: 6.4, 4.8 # figure size in inches
#figure.dpi: 100 # figure dots per inch
#figure.facecolor: white # figure face color
#figure.edgecolor: white # figure edge color
#figure.frameon: True # enable figure frame
#figure.max_open_warning: 20 # The maximum number of figures to open through
# the pyplot interface before emitting a warning.
# If less than one this feature is disabled.
#figure.raise_window : True # Raise the GUI window to front when show() is called.
## The figure subplot parameters. All dimensions are a fraction of the figure width and height.
#figure.subplot.left: 0.125 # the left side of the subplots of the figure
#figure.subplot.right: 0.9 # the right side of the subplots of the figure
#figure.subplot.bottom: 0.11 # the bottom of the subplots of the figure
#figure.subplot.top: 0.88 # the top of the subplots of the figure
#figure.subplot.wspace: 0.2 # the amount of width reserved for space between subplots,
# expressed as a fraction of the average axis width
#figure.subplot.hspace: 0.2 # the amount of height reserved for space between subplots,
# expressed as a fraction of the average axis height
## Figure layout
#figure.autolayout: False # When True, automatically adjust subplot
# parameters to make the plot fit the figure
# using `tight_layout`
#figure.constrained_layout.use: False # When True, automatically make plot
# elements fit on the figure. (Not
# compatible with `autolayout`, above).
#figure.constrained_layout.h_pad: 0.04167 # Padding around axes objects. Float representing
#figure.constrained_layout.w_pad: 0.04167 # inches. Default is 3/72 inches (3 points)
#figure.constrained_layout.hspace: 0.02 # Space between subplot groups. Float representing
#figure.constrained_layout.wspace: 0.02 # a fraction of the subplot widths being separated.
## ***************************************************************************
## * IMAGES *
## ***************************************************************************
#image.aspect: equal # {equal, auto} or a number
#image.interpolation: antialiased # see help(imshow) for options
#image.cmap: viridis # A colormap name (plasma, magma, etc.)
#image.lut: 256 # the size of the colormap lookup table
#image.origin: upper # {lower, upper}
#image.resample: True
#image.composite_image: True # When True, all the images on a set of axes are
# combined into a single composite image before
# saving a figure as a vector graphics file,
# such as a PDF.
## ***************************************************************************
## * CONTOUR PLOTS *
## ***************************************************************************
#contour.negative_linestyle: dashed # string or on-off ink sequence
#contour.corner_mask: True # {True, False}
#contour.linewidth: None # {float, None} Size of the contour line
# widths. If set to None, it falls back to
# `line.linewidth`.
#contour.algorithm: mpl2014 # {mpl2005, mpl2014, serial, threaded}
## ***************************************************************************
## * ERRORBAR PLOTS *
## ***************************************************************************
#errorbar.capsize: 0 # length of end cap on error bars in pixels
## ***************************************************************************
## * HISTOGRAM PLOTS *
## ***************************************************************************
#hist.bins: 10 # The default number of histogram bins or 'auto'.
## ***************************************************************************
## * SCATTER PLOTS *
## ***************************************************************************
#scatter.marker: o # The default marker type for scatter plots.
#scatter.edgecolors: face # The default edge colors for scatter plots.
## ***************************************************************************
## * AGG RENDERING *
## ***************************************************************************
## Warning: experimental, 2008/10/10
#agg.path.chunksize: 0 # 0 to disable; values in the range
# 10000 to 100000 can improve speed slightly
# and prevent an Agg rendering failure
# when plotting very large data sets,
# especially if they are very gappy.
# It may cause minor artifacts, though.
# A value of 20000 is probably a good
# starting point.
## ***************************************************************************
## * PATHS *
## ***************************************************************************
#path.simplify: True # When True, simplify paths by removing "invisible"
# points to reduce file size and increase rendering
# speed
#path.simplify_threshold: 0.111111111111 # The threshold of similarity below
# which vertices will be removed in
# the simplification process.
#path.snap: True # When True, rectilinear axis-aligned paths will be snapped
# to the nearest pixel when certain criteria are met.
# When False, paths will never be snapped.
#path.sketch: None # May be None, or a 3-tuple of the form:
# (scale, length, randomness).
# - *scale* is the amplitude of the wiggle
# perpendicular to the line (in pixels).
# - *length* is the length of the wiggle along the
# line (in pixels).
# - *randomness* is the factor by which the length is
# randomly scaled.
#path.effects:
## ***************************************************************************
## * SAVING FIGURES *
## ***************************************************************************
## The default savefig parameters can be different from the display parameters
## e.g., you may want a higher resolution, or to make the figure
## background white
#savefig.dpi: figure # figure dots per inch or 'figure'
#savefig.facecolor: auto # figure face color when saving
#savefig.edgecolor: auto # figure edge color when saving
#savefig.format: png # {png, ps, pdf, svg}
#savefig.bbox: standard # {tight, standard}
# 'tight' is incompatible with pipe-based animation
# backends (e.g. 'ffmpeg') but will work with those
# based on temporary files (e.g. 'ffmpeg_file')
#savefig.pad_inches: 0.1 # padding to be used, when bbox is set to 'tight'
#savefig.directory: ~ # default directory in savefig dialog, gets updated after
# interactive saves, unless set to the empty string (i.e.
# the current directory); use '.' to start at the current
# directory but update after interactive saves
#savefig.transparent: False # whether figures are saved with a transparent
# background by default
#savefig.orientation: portrait # orientation of saved figure, for PostScript output only
### tk backend params
#tk.window_focus: False # Maintain shell focus for TkAgg
### ps backend params
#ps.papersize: letter # {auto, letter, legal, ledger, A0-A10, B0-B10}
#ps.useafm: False # use of AFM fonts, results in small files
#ps.usedistiller: False # {ghostscript, xpdf, None}
# Experimental: may produce smaller files.
# xpdf intended for production of publication quality files,
# but requires ghostscript, xpdf and ps2eps
#ps.distiller.res: 6000 # dpi
#ps.fonttype: 3 # Output Type 3 (Type3) or Type 42 (TrueType)
### PDF backend params
#pdf.compression: 6 # integer from 0 to 9
# 0 disables compression (good for debugging)
#pdf.fonttype: 3 # Output Type 3 (Type3) or Type 42 (TrueType)
#pdf.use14corefonts: False
#pdf.inheritcolor: False
### SVG backend params
#svg.image_inline: True # Write raster image data directly into the SVG file
#svg.fonttype: path # How to handle SVG fonts:
# path: Embed characters as paths -- supported
# by most SVG renderers
# None: Assume fonts are installed on the
# machine where the SVG will be viewed.
#svg.hashsalt: None # If not None, use this string as hash salt instead of uuid4
### pgf parameter
## See https://matplotlib.org/tutorials/text/pgf.html for more information.
#pgf.rcfonts: True
#pgf.preamble: # See text.latex.preamble for documentation
#pgf.texsystem: xelatex
### docstring params
#docstring.hardcopy: False # set this when you want to generate hardcopy docstring
## ***************************************************************************
## * INTERACTIVE KEYMAPS *
## ***************************************************************************
## Event keys to interact with figures/plots via keyboard.
## See https://matplotlib.org/stable/users/explain/interactive.html for more
## details on interactive navigation. Customize these settings according to
## your needs. Leave the field(s) empty if you don't need a key-map. (i.e.,
## fullscreen : '')
#keymap.fullscreen: f, ctrl+f # toggling
#keymap.home: h, r, home # home or reset mnemonic
#keymap.back: left, c, backspace, MouseButton.BACK # forward / backward keys
#keymap.forward: right, v, MouseButton.FORWARD # for quick navigation
#keymap.pan: p # pan mnemonic
#keymap.zoom: o # zoom mnemonic
#keymap.save: s, ctrl+s # saving current figure
#keymap.help: f1 # display help about active tools
#keymap.quit: ctrl+w, cmd+w, q # close the current figure
#keymap.quit_all: # close all figures
#keymap.grid: g # switching on/off major grids in current axes
#keymap.grid_minor: G # switching on/off minor grids in current axes
#keymap.yscale: l # toggle scaling of y-axes ('log'/'linear')
#keymap.xscale: k, L # toggle scaling of x-axes ('log'/'linear')
#keymap.copy: ctrl+c, cmd+c # copy figure to clipboard
## ***************************************************************************
## * ANIMATION *
## ***************************************************************************
#animation.html: none # How to display the animation as HTML in
# the IPython notebook:
# - 'html5' uses HTML5 video tag
# - 'jshtml' creates a JavaScript animation
#animation.writer: ffmpeg # MovieWriter 'backend' to use
#animation.codec: h264 # Codec to use for writing movie
#animation.bitrate: -1 # Controls size/quality trade-off for movie.
# -1 implies let utility auto-determine
#animation.frame_format: png # Controls frame format used by temp files
## Path to ffmpeg binary. Unqualified paths are resolved by subprocess.Popen.
#animation.ffmpeg_path: ffmpeg
## Additional arguments to pass to ffmpeg.
#animation.ffmpeg_args:
## Path to ImageMagick's convert binary. Unqualified paths are resolved by
## subprocess.Popen, except that on Windows, we look up an install of
## ImageMagick in the registry (as convert is also the name of a system tool).
#animation.convert_path: convert
## Additional arguments to pass to convert.
#animation.convert_args: -layers, OptimizePlus
#
#animation.embed_limit: 20.0 # Limit, in MB, of size of base64 encoded
# animation in HTML (i.e. IPython notebook)
```

View File

@@ -1,9 +1,8 @@
---
title: Set API Keys
sidebar_position: 3
---
## **API Keys**
API keys can be managed directly from the SDK environment. If there is already a Terminal installation configured with API keys, they will be recognized by the SDK. Their status can be verified with the line of code below.
```python

View File

@@ -0,0 +1,16 @@
---
title: Importing and Exporting Data
sidebar_position: 4
---
The OpenBB SDK shares the `OpenBBUserData` folder with the Terminal, even with multiple versions installed on the same machine. Portfolio files, screener presets, and Matplotlib style sheets are all shared resources. This folder will be created after the first installation and it is read by subsequent installations. The default location for it is in the root of the operating system user account folder.
The `OpenBBUserData` folder's default location is the home of the system user account. By default this will be the following paths:
- macOS: `Macintosh HD/Users/<YOUR_USERNAME>/OpenBBUserData`
- Windows: `C:/Users/<YOUR_USERNAME>/OpenBBUserData`
Within the folder you can find files that you have exported as well as files that you wish to import directly into the OpenBB Terminal. For example, this could be an orderbook which you can store in `OpenBBUserData/portfolio/holdings`.
<img width="1231" alt="Screen Shot 2022-10-13 at 6 45 01 PM" src="https://user-images.githubusercontent.com/85772166/195742985-19f0e420-d8f7-4fea-a145-a0243b8f2ddc.png"></img>
This folder contains all things user-created which are, among other things screener presets, portfolio files, files exported directly from the code, styles and themes, preferred data sources and API keys.

View File

@@ -0,0 +1,53 @@
---
title: Structure of the SDK
sidebar_position: 1
---
## Importing the SDK
Once you have the OpenBB SDK installed, the first step is to import the OpenBB SDK in your preferred code editor. Nearly everything required to interact with any function from the OpenBB Terminal gets imported in one line. Begin a Python script or Notebook file with:
```python
from openbb_terminal.sdk import openbb
```
Note that most snippets used in the guides will assume the code block above is used, and that the `Python kernel` selected is the environment created during the [installation process](/sdk/quickstart/installation).
## Navigation
In the same way how the OpenBB Terminal is operated, functions are divided into menus which can be navigated after code completion is activated. Entering a period, `.`, after `openbb`, will display the Sub-menus available.
![Navigation](https://user-images.githubusercontent.com/85772166/202795900-5f1cb00a-a0ff-4899-b6e2-c5af54b653d1.png "Navigation")
An alternate way to view the contents of a menu is to use Python's built-in help.
```python
help(openbb.stocks.dd)
```
### Docstrings
In addition to Python's built-in help, docstrings are also displayed in the Contextual Help window, within a Jupyter environment; type hints are included.
```python
help(openbb.economy.events)
Help on Operation in module openbb_terminal.core.library.operation:
<openbb_terminal.core.library.operation.Operation object>
Get economic calendar for countries between specified dates
Parameters
----------
countries : [List[str],str]
List of countries to include in calendar. Empty returns all
start_date : str
Start date for calendar
end_date : str
End date for calendar
Returns
-------
pd.DataFrame
Economic calendar
```

View File

@@ -1,62 +1,15 @@
---
title: Basics
title: Using the SDK
sidebar_position: 2
---
### Importing the SDK
Now that you have the SDK installed, the first step is to import the OpenBB SDK in your preferred code editor. Nearly everything required to interact with any function from the OpenBB Terminal gets imported in one line. Begin a Python script or Notebook file with:
After you have imported the OpenBB SDK you are able to run many of the commands presents within the extensive list found [here]](/sdk/reference).
```python
from openbb_terminal.sdk import openbb
```
Example snippets used in the remainder of this guide will assume the code block above is used, and that the `Python kernel` selected is the environment created during the installation process.
### **Navigation**
In the same way as operating the OpenBB Terminal, functions are divided into menus which are scrollable after code completion is activated. Entering a period, `.`, after `openbb`, will display the Sub-menus available.
![Navigation](https://user-images.githubusercontent.com/85772166/202795900-5f1cb00a-a0ff-4899-b6e2-c5af54b653d1.png "Navigation")
An alternate way to view the contents of a menu is to use Python's built-in help.
```python
help(openbb.stocks.dd)
```
### **Docstrings**
In addition to Python's built-in help, docstrings are also displayed in the Contextual Help window, within a Jupyter environment or by running `help(openbb.economy.events)` in your code editor.
```python
help(openbb.economy.events)
Help on Operation in module openbb_terminal.core.library.operation:
<openbb_terminal.core.library.operation.Operation object>
Get economic calendar for countries between specified dates
Parameters
----------
countries : [List[str],str]
List of countries to include in calendar. Empty returns all
start_date : str
Start date for calendar
end_date : str
End date for calendar
Returns
-------
pd.DataFrame
Economic calendar
```
## Requesting and Handling Data
### Your First Function
To get started using the OpenBB SDK you can try the below code for your first function.
For example, you are able to show Economic events by running the following command. Note that the results from data functions are not stored to memory unless explicitly instructed to. Most functions that return data are presented as a Pandas DataFrame.
```python
openbb.economy.events()
@@ -70,16 +23,7 @@ openbb.economy.events()
| 3 | 02:00 | United Kingdom | Claimant Count Change | 3.3K | 17.3K | 3.9K | 2022-11-15 |
| 4 | 02:00 | United Kingdom | Employment Change 3M/3M | -52K | -25K | -109K | 2022-11-15 |
:::note - The results from data functions are not stored to memory unless explicitly instructed to. Most functions returning data are presented as a Pandas DataFrame.
:::
Modify the syntax slightly to deliver the output into a DataFrame:
```python
economic_calendar = openbb.economy.events()
```
Defined as a variable, interacting with the results becomes a matter of manipulating tables. For example, the code block below will filter the results of the events function to display only events scheduled at a specific time.
As most data is stored as a Pandas DataFrame, it is possible to adjust or filter the data directly through the use of the built-in functionalities of [Pandas](https://pandas.pydata.org/). For example, the code block below will filter the results of the events function to display only events scheduled at a specific time.
```python
economic_calendar = openbb.economy.events()
@@ -97,13 +41,7 @@ events
### Passing Results to Another Function
Let's take a look at another example where the input to a function is a list. It may be desirable to derive that list from a different function. This can be useful for screening tickers, or analyzing particular industries or sectors. The Comparison Analysis sub-module, within Stocks, is one set of functions that can benefit from this kind of workflow. Instead of something like:
```python
openbb.stocks.ca.screener(similar = ['AAPL', 'NFLX', 'META', 'AMZN', 'MSFT', 'GOOGL', 'DIS', 'TSLA'], data_type = 'valuation')
```
Try, `openbb.etf.holdings`, to populate a list dynamically:
It may be desirable to derive a list of tickers from a different function. This can be useful for screening tickers, or analyzing particular industries or sectors. The Comparison Analysis sub-module, within Stocks, has one set of functions that can benefit from this kind of workflow. As an example, holdings with the highest allocation of the [Dow Jones Industrial Average ETF](https://www.ssga.com/us/en/intermediary/etfs/funds/spdr-dow-jones-industrial-average-etf-trust-dia) are used.
```python
symbols = openbb.etf.holdings('DIA')
@@ -124,9 +62,12 @@ dia_valuation.head(5)
### Displaying Charts
The OpenBB SDK has built-in charting libraries for Matplotlib, for any chart available from the Terminal. User style sheets can be added to the folder (more on this in [User Settings](/sdk/guides/advanced/user-settings)), `~/OpenBBUserData/styles/user`. Styles are shared properties between the OpenBB Terminal and the SDK.
The OpenBB SDK has built-in charting libraries for Matplotlib, for any chart available from the Terminal. User style sheets can be added to the folder (more on this in [Importing and Exporting Data](/sdk/guides/basics/data)), `~/OpenBBUserData/styles/user`. Styles are shared properties between the OpenBB Terminal and the SDK.
Functions, such as `candle`, exist to display charts. Others, like those within the Technical Analysis module, have the option to return either, a chart or raw data. The next examples will outline a few different scenarios. Lets first get some data :
:::note Displaying charts in Jupyter Notebooks requires an additional line of code. You can either render a static image with `%matplotlib inline` or add in pan/zoom functionality with `%matplotlib widget`.
:::
Functions, such as `candle`, exist to display charts. Others, like those within the Technical Analysis module, have the option to return either, a chart or raw data. The next examples will outline a few different scenarios. First, let's get some data:
```python
spy_daily = openbb.stocks.load(
@@ -135,7 +76,7 @@ spy_daily = openbb.stocks.load(
monthly = True)
```
Data from the previous example, `spy_daily`, can feed the inputs to the `openbb.stocks.candle` function, for example:
Data from the previous example, `spy_daily`, can be used in the `openbb.stocks.candle` function, for example:
```python
openbb.stocks.candle(
@@ -147,6 +88,14 @@ openbb.stocks.candle(
![openbb.stocks.candle](https://user-images.githubusercontent.com/85772166/202801049-083ec045-7038-440b-8a54-7a02269e4a40.png "openbb.stocks.candle")
The function will also respond to individual tickers without saving the data first as done with `load`:
```python
openbb.stocks.candle('SPY')
```
![openbb.stocks.candle](https://user-images.githubusercontent.com/85772166/203477909-6a97175b-b3e3-4236-9753-609895c6aa69.png "openbb.stocks.candle")
Where functions in the Terminal display either a chart or raw data, the command will have an additional `_chart` component. For example, Donchian Channels:
```python
@@ -178,4 +127,4 @@ openbb.futures.curve_chart('GE')
![openbb.futures.curve](https://user-images.githubusercontent.com/85772166/201583945-18364efa-c305-4c1a-a032-f779e28894c8.png "openbb.futures.curve")
The guides section for each module explore further functionality and provide sample code snippets.
The intros section for each module explore further functionality and provide sample code snippets.

View File

@@ -4,18 +4,10 @@ keywords: ["portfolio", "optimization", "mean variance", "risk parity", "black l
"hierarchical clustering models"]
excerpt: "The Introduction to Portfolio Optimization within the Portfolio menu explains how to use various portfolio
optimization techniques and provides a brief description of its sub-menus"
geekdocCollapseSection: true
---
The Portfolio Optimization menu allows the user to apply advanced optimization techniques to a portfolio of any type
and of any size. It does so by introducing a multitude of optimization techniques ranging from <a href="https://www.investopedia.com/terms/m/meanvariance-analysis.asp" target="_blank">mean-variance optimization</a>
to <a href="https://www.investopedia.com/terms/r/risk-parity.asp" target="_blank">risk parity models</a> and
<a href="https://www.investopedia.com/terms/c/cluster_analysis.asp" target="_blank">hierarchical clustering models</a>.
By providing Excel templates, the user can make sense of the vast array of parameters that each command has. E.g. think
of the historic period you wish to use or which of the more than 10 risk measures and covariance methods should be used?
These are questions the templates make easier to answer.
The Portfolio Optimization menu allows the user to apply advanced optimization techniques to a portfolio of any type and of any size. It does so by introducing a multitude of optimization techniques ranging from <a href="https://www.investopedia.com/terms/m/meanvariance-analysis.asp" target="_blank">mean-variance optimization</a> to <a href="https://www.investopedia.com/terms/r/risk-parity.asp" target="_blank">risk parity models</a> and <a href="https://www.investopedia.com/terms/c/cluster_analysis.asp" target="_blank">hierarchical clustering models</a>. By providing Excel templates, the user can make sense of the vast array of parameters that each command has. E.g. think of the historic period you wish to use or which of the more than 10 risk measures and covariance methods should be used? These are questions the templates make easier to answer.
The capabilities of the [Portfolio Optiminzation menu](/terminal/guides/portfolio/po) from the OpenBB Terminal are wrapped into a powerful SDK, enabling users to work with the data in a flexible environment that can be fully customized to meet the needs of any user. These functionalities allow the user to apply advanced optimization techniques to a portfolio of any type and of any size. It does so by introducing a multitude of optimization techniques ranging from <a href="https://www.investopedia.com/terms/m/meanvariance-analysis.asp" target="_blank">mean-variance optimization</a> to <a href="https://www.investopedia.com/terms/r/risk-parity.asp" target="_blank">risk parity models</a> and <a href="https://www.investopedia.com terms/c/cluster_analysis.asp" target="_blank">hierarchical clustering models</a>.
By providing Excel templates, the user can make sense of the vast array of parameters that each command has. E.g. think of the historic period you wish to use or which of the more than 10 risk measures and covariance methods should be used? These are questions the templates make easier to answer.
The capabilities of the [Portfolio Optiminzation menu](/terminal/guides/portfolio/po) from the OpenBB Terminal are wrapped into a powerful SDK, enabling users to work with the data in a flexible environment that can be fully customized to meet the needs of any user. These functionalities allow the user to apply advanced optimization techniques to a portfolio of any type and of any size. It does so by introducing a multitude of optimization techniques ranging from <a href="https://www.investopedia.com/terms/m/meanvariance-analysis.asp" target="_blank">mean-variance optimization</a> to <a href="https://www.investopedia.com/terms/r/risk-parity.asp" target="_blank">risk parity models</a> and <a href="https://www.investopedia.com terms/c/cluster_analysis.asp" target="_blank">hierarchical clustering models</a>. By providing Excel templates, the user can make sense of the vast array of parameters that each command has. E.g. think of the historic period you wish to use or which of the more than 10 risk measures and covariance methods should be used? These are questions the templates make easier to answer.
## How to use
Start a Python script or Notebook file by importing the module:
@@ -24,22 +16,15 @@ Start a Python script or Notebook file by importing the module:
from openbb_terminal.sdk import openbb
```
This menu requires the usage of the Excel templates to work properly. As there is a lot of complexity involved around
these techniques, these templates allow the user to understand what values for each parameter are actually used and
allow for an easy way to define the allocation.
This menu requires the usage of the Excel templates to work properly. As there is a lot of complexity involved around these techniques, these templates allow the user to understand what values for each parameter are actually used and allow for an easy way to define the allocation.
> For this there are two templates that need to be set, the **OpenBB Parameters Template** and the **OpenBB Portfolio Template**. These files can be found in the
`OpenBBUserData` folder. Please see <a href="https://openbb-finance.github.io/OpenBBTerminal/#importing-and-exporting-data-in-the-openbb-terminal" target="_blank">this guide</a> for how to find this folder.
:::note For this there are two templates that need to be set, the **OpenBB Parameters Template** and the **OpenBB Portfolio Template**. These files can be found in [here](https://github.com/OpenBB-finance/OpenBBTerminal/tree/main/openbb_terminal/miscellaneous/portfolio_examples). Select a file and press "Download" on the right, then place it into the OpenBBUserData folder. You can find more about this folder [here](/sdk/basics/data).
:::
### OpenBB Parameters Template
This template provides the user with the ability to set define values for each parameter based on the optimization
technique that is deployed. E.g. if you select `riskparity` for the `technique` parameter, you will notice that some
parameters turn <span style={{color: "#BEBEBE"}}>grey</span>. This means that the parameter is irrelevant for the selected
method.
This template provides the user with the ability to set define values for each parameter based on the optimization technique that is deployed. E.g. if you select `riskparity` for the `technique` parameter, you will notice that some parameters turn <span style={{color: "#BEBEBE"}}>grey</span>. This means that the parameter is irrelevant for the selected method.
The OpenBB Terminal does, however, allow the user to run any model despite the `technique` you selected. Therefore, if
you are interested in running multiple models, consider removing the value for `technique`. Do note that this makes it
more difficult to understand which values are used for which model.
The OpenBB Terminal does, however, allow the user to run any model despite the `technique` you selected. Therefore, if you are interested in running multiple models, consider removing the value for `technique`. Do note that this makes it more difficult to understand which values are used for which model.
<a target="_blank" href="https://user-images.githubusercontent.com/46355364/171144692-dd812efd-1e95-4a71-a93f-7ae8a480fe5d.png"><img alt="OpenBB Parameters Template" src="https://user-images.githubusercontent.com/46355364/171144692-dd812efd-1e95-4a71-a93f-7ae8a480fe5d.png"></img></a>
@@ -47,7 +32,7 @@ Once you have defined the parameters, save the template and load it inside the t
```python
# Define your orderbook path here
order_book_path = "60_40_Portfolio.xlsx"
order_book_path = "PATH_TO_ORDERBOOK_FILE"
# Read in the file
order_book = pd.read_excel(order_book_path)
@@ -60,10 +45,7 @@ order_book = order_book[order_book_cols]
```
### OpenBB Portfolio Template
This template hands the user a format to work with it to define the portfolio. Here, categorization is applied
based on asset class, sector, industry, country and currency. By using the dropdown menus within this Excel, you
are able to apply the proper categorization. This is based on the same methodology as found in other areas of the
terminal.
This template hands the user a format to work with it to define the portfolio. Here, categorization is applied based on asset class, sector, industry, country and currency. By using the dropdown menus within this Excel, you are able to apply the proper categorization. This is based on the same methodology as found in other areas of the terminal.
<a target="_blank" href="https://user-images.githubusercontent.com/46355364/171145061-cd618153-801c-4771-ba57-7ee0ab8c57e8.png"><img alt="OpenBB Portfolio Template" src="https://user-images.githubusercontent.com/46355364/171145061-cd618153-801c-4771-ba57-7ee0ab8c57e8.png"></img></a>
@@ -73,7 +55,7 @@ You can load in the portfolio template with the following code:
import pandas as pd
# Define your own orderbook path here, current value won't work
order_book_path = "60_40_Portfolio.xlsx"
order_book_path = "PATH_TO_ORDERBOOK_FILE"
# Read in the file
order_book = pd.read_excel(order_book_path)
@@ -89,10 +71,7 @@ tickers, categories = openbb.portfolio.po.load(order_book_path)
```
### Performing optimization
Based on the parameters and allocation the user has set, the optimization process begins. What optimization
technique is ideal depends entirely on the user's risk profile and objectives. As an illustration,
<a href="https://www.investopedia.com/terms/r/risk-parity.asp" target="_blank">Risk Parity</a>
is presented below:
Based on the parameters and allocation the user has set, the optimization process begins. What optimization technique is ideal depends entirely on the user's risk profile and objectives. As an illustration, <a href="https://www.investopedia.com/terms/r/risk-parity.asp" target="_blank">Risk Parity</a> is presented below:
```python
# Perform calculations
@@ -118,10 +97,7 @@ Which returns:
| TLT | 0.21927 |
| TSM | 0.04626 |
It is possible to use the commands without loading in the parameters template or by using the parameters template but
changing some arguments directly into the terminal. For example, using the same method as described above, the risk
measure is changed to <a href="https://www.investopedia.com/terms/c/conditional_value_at_risk.asp" target="_blank">Conditional Value at Risk (CVaR)</a>
and the used historic period is increased to 10 years (keeping all other parameters unchanged):
It is possible to use the commands without loading in the parameters template or by using the parameters template but changing some arguments directly into the terminal. For example, using the same method as described above, the risk measure is changed to <a href="https://www.investopedia.com/terms/c/conditional_value_at_risk.asp" target="_blank">Conditional Value at Risk (CVaR)</a> and the used historic period is increased to 10 years (keeping all other parameters unchanged):
```python
weights_riskparity, data_returns_riskparity = openbb.portfolio.po.riskparity(tickers, interval="10y", risk_measure="CVaR")
@@ -145,14 +121,13 @@ Which returns:
## Examples
To demonstrate the capabilities of the Portfolio Optimization menu, the entire <a href="https://www.investopedia.com/terms/s/sp500.asp" target="_blank">S&P 500 index</a> (as of 30th of May 2022)
is used and optimized and analysed in a variety of ways. Starting by loading in the dataset with the following:
To demonstrate the capabilities of the Portfolio Optimization menu, the entire <a href="https://www.investopedia.com/terms/s/sp500.asp" target="_blank">S&P 500 index</a> (as of 30th of May 2022) is used and optimized and analysed in a variety of ways. Starting by loading in the dataset with the following:
```python
import pandas as pd
# Define your own orderbook path here, current value won't work
order_book_path = "SP_500_Portfolio.xlsx"
order_book_path = "PATH_TO_ORDERBOOK_FILE"
# Read in the file
order_book = pd.read_excel(order_book_path)
@@ -196,8 +171,7 @@ This results in the following (the result is edited, as it would show 500 ticker
| ZION | 0.0014 |
| ZTS | 0.00225 |
It is possible to delve further into these findings with the `plot` functionality for example done by looking at the portfolio's returns <a href="https://www.investopedia.com/terms/h/histogram.asp" target="_blank">histogram</a>
which also includes a variety of risk measures as well as the portfolio's drawdowns.
It is possible to delve further into these findings with the `plot` functionality for example done by looking at the portfolio's returns <a href="https://www.investopedia.com/terms/h/histogram.asp" target="_blank">histogram</a> which also includes a variety of risk measures as well as the portfolio's drawdowns.
````
openbb.portfolio.po.plot(data=data_returns_hrp, weights=weights_hrp, risk_measure='cVaR', hist=True)
@@ -209,4 +183,4 @@ openbb.portfolio.po.plot(data=data_returns_hrp, weights=weights_hrp, risk_measur
openbb.portfolio.po.plot(data=data_returns_hrp, weights=weights_hrp, risk_measure='cVaR', dd=True)
````
<a target="_blank" href="https://user-images.githubusercontent.com/46355364/171145983-2d2c1c2e-67d2-4839-b43a-51bd22332de8.png"><img alt="Portfolio Drawdowns" src="https://user-images.githubusercontent.com/46355364/171145983-2d2c1c2e-67d2-4839-b43a-51bd22332de8.png"></img></a>
<a target="_blank" href="https://user-images.githubusercontent.com/46355364/171145983-2d2c1c2e-67d2-4839-b43a-51bd22332de8.png"><img alt="Portfolio Drawdowns" src="https://user-images.githubusercontent.com/46355364/171145983-2d2c1c2e-67d2-4839-b43a-51bd22332de8.png"></img></a>

View File

@@ -6,26 +6,11 @@ import Card from "@site/src/components/General/Card";
# Introduction
OpenBB SDK gives you direct and programmatic access to all capabilities from
OpenBB Terminal. You will have the necessary building blocks to create your own
financial tools and applications, whether that be a visualization dashboard or a
custom report on Jupyter Notebook.
OpenBB SDK gives you direct and programmatic access to all capabilities from OpenBB Terminal. You will have the necessary building blocks to create your own financial tools and applications, whether that be a visualization dashboard or a custom report on Jupyter Notebook.
With OpenBB SDK, you can gain access to normalized financial data from dozens of
data providers, without having to develop your own integrations from scratch. On
top of financial data feeds, OpenBB SDK also provides you with a toolbox to
perform financial analysis on a variety of asset classes, including stocks,
crypto, ETFs, funds, and the economy as well as portfolio optimization and
analysis.
With OpenBB SDK, you can gain access to normalized financial data from dozens of data providers, without having to develop your own integrations from scratch. On top of financial data feeds, OpenBB SDK also provides you with a toolbox to perform financial analysis on a variety of asset classes, including stocks, crypto, ETFs, funds, and the economy as well as portfolio optimization and attribution.
OpenBB SDK is created and maintained by the OpenBB team together with the
contributions from hundreds of community members. This gives us an unrivaled
speed of development and the ability to maintain stable integrations with
numerous third-party data providers. Developing and maintaining a full-blown
investment research infrastructure from the ground up takes a lot of time and
effort. However, it does not have to be this way. By taking advantage of OpenBB
SDK with its out-of-the-box data connectors and financial analysis toolkit, now
you can focus on designing and building your financial reports and applications.
OpenBB SDK is created and maintained by the OpenBB team together with the contributions from hundreds of community members. This gives us an unrivaled speed of development and the ability to maintain stable integrations with numerous third-party data providers. Developing and maintaining a full-blown investment research infrastructure from the ground up takes a lot of time and effort. However, it does not have to be this way. By taking advantage of OpenBB SDK with its out-of-the-box data connectors and financial analysis toolkit, now you can focus on designing and building your financial reports and applications.
---
@@ -47,22 +32,16 @@ build financial applications and reports."
### Getting Started
To know more about OpenBB SDK, you can start by reading the
[Installation Guide](/sdk/quickstart/installation).
To know more about OpenBB SDK, you can start by reading the [Installation Guide](/sdk/quickstart/installation).
### Using OpenBB SDK
To learn how to use OpenBB SDK, you can start by reading the
[Getting Started Guide](/sdk/guides/basics).
To learn how to use OpenBB SDK, you can start by reading the [Structure of the SDK](/sdk/guides/basics/structure) and [Using the SDK](/sdk/guides/basics/using) guides.
### SDK Functions
SDK Reference is a complete list of all functions available in OpenBB SDK. It is
automatically generated and updated every time a new version of OpenBB SDK is
released. It can be found [here](/sdk/reference).
SDK Reference is a complete list of all functions available in OpenBB SDK. It is automatically generated and updated every time a new version of OpenBB SDK is released. It can be found [here](/sdk/reference).
### Showcase
OpenBB SDK is used by many financial analysts, data scientists, and developers
to build financial applications and reports. Here are some examples of what you
can do with OpenBB SDK: [Showcase](/sdk/showcase).
OpenBB SDK is used by many financial analysts, data scientists, and developers to build financial applications and reports. Here are some examples of what you can do with OpenBB SDK: [Showcase](/sdk/showcase).

View File

@@ -3,13 +3,20 @@ title: FAQ
sidebar_position: 3
---
# FAQ
## General
<details><summary>How do I update the OpenBB SDK?</summary>
<p>
With new releases of the OpenBB SDK, it would suffice to use `pip install openbb`. If this doesn't update to the latest version you can include the version number as follows `pip install openbb==2.0.0`. Please find the latest version [here](https://pypi.org/project/openbb/).
</p>
</details>
<details><summary>Where does the data from the OpenBB SDK come from?</summary>
<p>
The OpenBB platform does not provide any data itself as the platform is a data aggregator that connects to
almost a hundred different data providers and APIs to access the data.
The OpenBB platform does not provide any data itself as the platform is a data aggregator that connects to almost a hundred different data providers and APIs to access the data.
</p>
</details>
@@ -46,22 +53,41 @@ An installation will use approximately 4GB of space.
</p>
</details>
<details><summary>How do I launch Jupyter Lab for use with the OpenBB SDK?</summary>
<details><summary>How do I launch Jupyter Lab or Jupyter Notebook for use with the OpenBB SDK?</summary>
<p>
From the command line, with the environment active, and from the root of the local installation folder, enter: `jupyter lab`. A browser window will launch.
Once the installation is finished via `pip` and you have activated the conda environment, as explained in the [installation guide](/sdk/quickstart/installation) you are able to activate a Jupyter Notebook by running `jupyter notebook` or Jupyter Lab with `jupyter lab`. Then, you should be able to use the OpenBB SDK by following along with the [Structure of the SDK](/sdk/guides/basics/structure) and [Using the SDK](/sdk/guides/basics/using) guides.
</p>
</details>
<details><summary>Why is data from today missing when I use the load function?</summary>
<details><summary>How can I contribute to the OpenBB SDK</summary>
<p>
By default, the load function requests end-of-day daily data and is not included until the EOD summary has been published. The current day's data is considered intraday and is loaded when the `interval` argument is present.
There are three main ways of contributing to this project.
**BECOME A CONTRIBUTOR**
1. Fork the [Project](https://github.com/OpenBB-finance/OpenBBTerminal)
2. Create your Feature Branch (`git checkout -b feature/AmazingFeature`)
3. Install the pre-commit hooks by running: `pre-commit install`
Any time you commit a change, linters will be run automatically. On changes, you will have to re-commit
4. Commit your Changes (`git commit -m 'Add some AmazingFeature'`)
5. Push to your Branch (`git push origin feature/AmazingFeature`)
6. Open a Pull Request
You can read more details about adding a feature in our [CONTRIBUTING GUIDELINES](https://github.com/OpenBB-finance/OpenBBTerminal/blob/main/CONTRIBUTING.md).
**RAISE AN ISSUE OR REQUEST A FEATURE**
- Raise an issue by opening a [bug ticket](https://github.com/OpenBB-finance/OpenBBTerminal/issues).
- Request a new feature through a [feature request ticket](https://github.com/OpenBB-finance/OpenBBTerminal/issues).
</p>
</details>
## Support
<details><summary>How do I report a bug?</summary>
<p>
@@ -73,9 +99,18 @@ First, search the open issues for another report. If one already exists, attach
<details><summary>How can I get help with OpenBB SDK?</summary>
<p>
You can get help with OpenBB SDK by joining our
[Discord server](https://openbb.co/discord) or contact us in our support form
[here](https://openbb.co/support).
You can get help with OpenBB SDK by joining our [Discord server](https://openbb.co/discord) or contact us in our support form [here](https://openbb.co/support).
</p>
</details>
## Functionality
<details><summary>Why is data from today missing when I use the load function?</summary>
<p>
By default, the load function requests end-of-day daily data and is not included until the EOD summary has been published. The current day's data is considered intraday and is loaded when the `interval` argument is present.
</p>
</details>

View File

@@ -3,12 +3,7 @@ title: Installation
sidebar_position: 2
---
We provide a simple installation method in order to utilize the OpenBB SDK. You must first create an environment,
which allows you to isolate the SDK from the rest of your system. It is our recommendation that you utilize a
`conda` environment because there are optional features, such as `forecast`, that utilize libraries that are
specifically sourced from `conda-forge`. Due to this, if you do not use a conda environment, you will not be
able to use some of these features. As such, the installation steps will be written under the assumption that
you are using conda.
We provide a simple installation method in order to utilize the OpenBB SDK. You must first create an environment, which allows you to isolate the SDK from the rest of your system. It is our recommendation that you utilize a `conda` environment because there are optional features, such as `forecast`, that utilize libraries that are specifically sourced from `conda-forge`. Due to this, if you do not use a conda environment, you will not be able to use some of these features. As such, the installation steps will be written under the assumption that you are using conda.
## Steps
@@ -80,6 +75,10 @@ And install the Both Toolkits
pip install "openbb[all]"
```
Congratulations! You have successfully installed `openbb` on an environment and are now able to begin using it. However, it is important to note that if you close out of your CLI you must re-activate your environment in order begin using it again.
Congratulations! You have successfully installed `openbb` on an environment and are now able to begin using it. However, it is important to note that if you close out of your CLI you must re-activate your environment in order begin using it again. This can be done with the following:
The Terminal can now be launched by entering, `openbb`, and the SDK can be imported to a Jupyter Notebook file or code editor with, `from openbb_terminal.sdk import openbb`
```bash
conda activate obb
```
The OpenBB SDK can be imported to a Jupyter Notebook or any code editor with, `from openbb_terminal.sdk import openbb` as explained in the [Structure of the SDK](/sdk/guides/basics/structure) and [Using the SDK](/sdk/guides/basics/using) guides. By following the above process, the [OpenBB Terminal](/terminal) is automatically included as well which can be ran by typing `openbb`.

View File

@@ -15,9 +15,7 @@ The OpenBB SDK is a set of tools for financial and data analysis. The purpose of
- A code editor or Jupyter Notebook
- Internet connection
:::note NOTES ON THE INTERNET CONNECTIVITY
Installation of the SDK with all the toolkits would require downloading around 4GB of data. Querying data does not require a lot of bandwidth but you will certainly have a more pleasant experience if you will be on a fast internet line. 4G networks provide a good enough experience so if you're traveling your personal hot-spot will do. While it's technically possible to use a subset of the functionality in off-line mode, you will not be able to use any data that is queried from the APIs of data providers and services.
:::info
Note that installation of the SDK with all the toolkits would require downloading around 4GB of data. Querying data does not require a lot of bandwidth but you will certainly have a more pleasant experience if you will be on a fast internet line. 4G networks provide a good enough experience so if you're traveling your personal hot-spot will do. While it's technically possible to use a subset of the functionality in off-line mode, you will not be able to use any data that is queried from the APIs of data providers and services.
:::info OS Specific Requirements

View File

@@ -10,7 +10,7 @@ Within the folder you can find files that you have exported as well as files tha
<img width="1231" alt="Screen Shot 2022-10-13 at 6 45 01 PM" src="https://user-images.githubusercontent.com/85772166/195742985-19f0e420-d8f7-4fea-a145-a0243b8f2ddc.png"></img>
This folder contains all things user-created:
This folder contains all things user-created. For example:
- Screener presets
- Portfolio files

View File

@@ -2,6 +2,9 @@
title: FAQ
sidebar_position: 3
---
## General
<details><summary>Where does the data from the OpenBB Terminal come from?</summary>
<p>
@@ -43,14 +46,33 @@ An installation will use approximately 2GB of space.
</p>
</details>
<details><summary>Why is data from today missing when I use the load function?</summary>
<details><summary>How can I contribute to the OpenBB Terminal</summary>
<p>
By default, the load function requests end-of-day daily data and is not included until the EOD summary has been published. The current day's data is considered intraday and is loaded when the `interval` argument is present.
There are three main ways of contributing to this project.
**BECOME A CONTRIBUTOR**
1. Fork the [Project](https://github.com/OpenBB-finance/OpenBBTerminal)
2. Create your Feature Branch (`git checkout -b feature/AmazingFeature`)
3. Install the pre-commit hooks by running: `pre-commit install`
Any time you commit a change, linters will be run automatically. On changes, you will have to re-commit
4. Commit your Changes (`git commit -m 'Add some AmazingFeature'`)
5. Push to your Branch (`git push origin feature/AmazingFeature`)
6. Open a Pull Request
You can read more details about adding a feature in our [CONTRIBUTING GUIDELINES](https://github.com/OpenBB-finance/OpenBBTerminal/blob/main/CONTRIBUTING.md).
**RAISE AN ISSUE OR REQUEST A FEATURE**
- Raise an issue by opening a [bug ticket](https://github.com/OpenBB-finance/OpenBBTerminal/issues).
- Request a new feature through a [feature request ticket](https://github.com/OpenBB-finance/OpenBBTerminal/issues).
</p>
</details>
## Support
<details><summary>How do I report a bug?</summary>
<p>
@@ -66,3 +88,190 @@ You can get help with OpenBB SDK by joining our [Discord server](https://openbb.
</p>
</details>
## Functionality
<details><summary>Why is data from today missing when I use the load function?</summary>
<p>
By default, the load function requests end-of-day daily data and is not included until the EOD summary has been published. The current day's data is considered intraday and is loaded when the `interval` argument is present.
</p>
</details>
<details><summary>Why does a specific menu or command not exist?</summary>
<p>
It could be that you are running an outdated version in which the menu or command is not yet available. Please check use the [installation guide](https://docs.openbb.co/terminal/quickstart/installation) to download the most recent release.
Do note that it is also possible that the menu or command is removed. If this is undesirable, please reach out to us [here](https://openbb.co/support).
</p>
</details>
## Source
<details><summary>How do I update the OpenBB Terminal?</summary>
<p>
The terminal is constantly being updated with new features and bug fixes, hence, for your terminal to be update, you can use `git pull` to get the latest changes:
```bash
git pull
```
If this fails due to the fact that you had modified some python files, and there's a conflict with the updates, you can use:
```bash
git stash
```
Then, re-run `poetry install` to get any new dependencies. Once installation is finished, you're ready to use the OpenBB Terminal again. If you `stashed` your changes previously, you can un-stash them with:
```bash
git stash pop
```
**NOTE:** When you close the terminal and re-open it, the only command you need to re-call is `conda activate obb`
before you call `openbb` again.
</p>
</details>
<details><summary>Why do I get too many red error lines on Windows?</summary>
<p>
If you are on Windows and your terminal has too many red error lines, it is likely that this is the issue. Go to this page and install the 2019 Build Tools (not the latest) found [here](https://answers.microsoft.com/en-us/windows/forum/windows_other-windows_install/microsoft-visual-c-140/6f0726e2-6c32-4719-9fe5-aa68b5ad8e6d)
</p>
</details>
<details><summary>What does it mean if it says wheel is missing?</summary>
<p>
If you receive any notifications regarding `wheel` missing, this could be due to this dependency missing.
`conda install -c conda-forge wheel` or `pip install wheel`
</p>
</details>
<details><summary>Why do these .whl files not exist?</summary>
<p>
If you get errors about .whl files not existing (usually on Windows) you have to reinitialize the following folder.
Just removing the 'artifacts' folder could also be enough:
| Platform | Location |
| -------- | ------------------------------- |
| Linux | "~/.cache/pypoetry" |
| Mac | "~/Library/Caches/pypoetry" |
| Windows | "%localappdata%/pypoetry/cache" |
When you try to add a package to Poetry it is possible that it causes a similar issue. Here you can remove the
'artifacts' folder again to reinitialize Poetry.
If you run into trouble with Poetry, and the advice above did not help, your best bet is to try
1. `poetry update --lock`
2. `conda deactivate` -> `conda activate obb`, then try again
3. Track down the offensive package and purge it from your anaconda `<environment_name>` folder, then try again
(removing through conda can sometimes leave locks behind)
| Platform | Location |
| --------- | -------------------------------------------- |
| Linux/Mac | "~/anaconda3/envs" or "~/opt/anaconda3/envs" |
| Windows | "%userprofile%/anaconda3/envs" |
4. Completely nuke your conda environment folder and make a new environment from scratch
5. Reboot your computer and try again
6. Submit a ticket on GitHub
</p>
</details>
<details><summary>What does the JSONDecodeError mean during poetry install?</summary>
<p>
Sometimes poetry can throw a `JSONDecodeError` on random packages while running `poetry install`. This can be observed on macOS 10.14+ running python 3.8+. This is because of the use of an experimental installer that can be switched off to avoid the mentioned error. Run the code below as advised [here](https://github.com/python-poetry/poetry/issues/4210) and it should fix the installation process.
```bash
poetry config experimental.new-installer false
```
</p>
</details>
<details><summary>Why do a receive a ModuleNotFoundError?</summary>
<p>
In the case when you run into an error of the form `ModuleNotFoundError: No module named '_______'` before you start installing these modules that have not been found please check that you have most followed the recommended installation instructions.
These errors often can occur when you have not activated the virtual environment where you have installed the terminal, or you have not used the `poetry install` command to install the dependencies.
In case you wish to proceed with an alternative way to install the terminal feel free to install the missing packages via pip. For example if you get the error that `yfinance` is not found, you would run `pip install yfinance`
</p>
</details>
<details><summary>How do I fix "Cannot convert a symbolic Tensor..."?</summary>
<p>
If you run into issues installing or `Cannot convert a symbolic Tensor...` at runtime, try this:
```bash
poetry install
poetry install -E prediction
```
_Commands that may help you in case of an error:_
- `python -m pip install --upgrade pip`
- `poetry update --lock`
- `poetry install`
</p>
</details>
<details><summary>How do I deal with errors regarding CRLF?</summary>
<p>
When trying to commit code changes, pylint will prevent you from doing so if your line break settings are set to
CRLF (default for Windows).
This is because the entire package uses LF (default for Linux/Mac), and it is therefore
important that you change this setting to LF _before_ you make any changes to the code.
It is possible that CRLF automatically turns back on, you can correct this with:
```bash
git config --global core.autocrlf false
```
In case you already made coding adjustments, you have to reset your cache, and the changes you made to the code with
the following:
```bash
git rm --cached -r .
git reset --hard
```
</p>
</details>
<details><summary>Why can't I run openbb via the VS Code integrated terminal?</summary>
<p>
This occurs when VS Code terminal python version/path is different from the terminal version.
To fix it add this to vscode JSON settings ([ref](https://stackoverflow.com/questions/54582361/vscode-terminal-shows-incorrect-python-version-and-path-launching-terminal-from)):
```bash
"terminal.integrated.inheritEnv": false,
```
</p>
</details>

View File

@@ -451,29 +451,6 @@ Since WSL installation is headless by default (i.e., you have only access to a t
3. When running the program is important to check "Disable access control"
After this, `VcXsrv` should be running successfully and we can proceed to terminal installation.
## Update Terminal
The terminal is constantly being updated with new features and bug fixes, hence, for your terminal to be update, you can use `git pull` to get the latest changes:
```bash
git pull
```
If this fails due to the fact that you had modified some python files, and there's a conflict with the updates, you can use:
```bash
git stash
```
Then, re-run `poetry install` to get any new dependencies. Once installation is finished, you're ready to use the OpenBB Terminal again. If you `stashed` your changes previously, you can un-stash them with:
```bash
git stash pop
```
**NOTE:** When you close the terminal and re-open it, the only command you need to re-call is `conda activate obb`
before you call `openbb` again.
</TabItem>
</Tabs>

View File

@@ -1,119 +0,0 @@
---
sidebar_position: 4
title: Troubleshooting
---
If you are visiting this page it means that you're having issues installing. We apologize for that. Since the start of the project we've come across different types of issues experienced by the users. This page tries to combine issues, and their solutions. This will allow to give the best install experience to everyone regardless of any programming skills.
**Note:** these instructions are meant for users that use the source version (from [GitHub](https://github.com/OpenBB-finance/OpenBBTerminal))
## Standard Install Troubles
### Microsoft Visual C++
If you are on Windows and your terminal has too many red error lines, it is likely that this is the issue. Go to this page and install the 2019 Build Tools (not the latest) found [here](https://answers.microsoft.com/en-us/windows/forum/windows_other-windows_install/microsoft-visual-c-140/6f0726e2-6c32-4719-9fe5-aa68b5ad8e6d)
### Wheel
If you receive any notifications regarding `wheel` missing, this could be due to this dependency missing.
`conda install -c conda-forge wheel` or `pip install wheel`
### Poetry
If you get errors about .whl files not existing (usually on Windows) you have to reinitialize the following folder.
Just removing the 'artifacts' folder could also be enough:
| Platform | Location |
| -------- | ------------------------------- |
| Linux | "~/.cache/pypoetry" |
| Mac | "~/Library/Caches/pypoetry" |
| Windows | "%localappdata%/pypoetry/cache" |
When you try to add a package to Poetry it is possible that it causes a similar issue. Here you can remove the
'artifacts' folder again to reinitialize Poetry.
If you run into trouble with Poetry, and the advice above did not help, your best bet is to try
1. `poetry update --lock`
2. `conda deactivate` -> `conda activate obb`, then try again
3. Track down the offensive package and purge it from your anaconda `<environment_name>` folder, then try again
(removing through conda can sometimes leave locks behind)
| Platform | Location |
| --------- | -------------------------------------------- |
| Linux/Mac | "~/anaconda3/envs" or "~/opt/anaconda3/envs" |
| Windows | "%userprofile%/anaconda3/envs" |
4. Completely nuke your conda environment folder and make a new environment from scratch
5. Reboot your computer and try again
6. Submit a ticket on GitHub
#### JSONDecodeError during `poetry install`
Sometimes poetry can throw a `JSONDecodeError` on random packages while running `poetry install`.
This can be observed on macOS 10.14+ running python 3.8+.
This is because of the use of an experimental installer that can be switched off to avoid the mentioned error.
Run
```bash
poetry config experimental.new-installer false
```
as advised [here](https://github.com/python-poetry/poetry/issues/4210) and it should fix the installation process.
## ModuleNotFoundError Trouble
In the case when you run into an error of the form `ModuleNotFoundError: No module named '_______'` before you start installing these modules that have not been found please check that you have most followed the recommended installation instructions.
These errors often can occur when you have not activated the virtual environment where you have installed the terminal, or you have not used the `poetry install` command to install the dependencies.
In case you wish to proceed with an alternative way to install the terminal feel free to install the missing packages via pip. For example if you get the error that `yfinance` is not found, you would run `pip install yfinance`
## Machine Learning Troubles
If you run into issues installing or `Cannot convert a symbolic Tensor...` at runtime, try this:
```bash
poetry install
poetry install -E prediction
```
_Commands that may help you in case of an error:_
- `python -m pip install --upgrade pip`
- `poetry update --lock`
- `poetry install`
## CRLF versus LF
When trying to commit code changes, pylint will prevent you from doing so if your line break settings are set to
CRLF (default for Windows).
This is because the entire package uses LF (default for Linux/Mac), and it is therefore
important that you change this setting to LF _before_ you make any changes to the code.
It is possible that CRLF automatically turns back on, you can correct this with:
```bash
git config --global core.autocrlf false
```
In case you already made coding adjustments, you have to reset your cache, and the changes you made to the code with
the following:
```bash
git rm --cached -r .
git reset --hard
```
## Unable to run openbb from VS Code integrated terminal
Occurs when vscode terminal python version/path is different from the terminal version.
To fix it add this to vscode JSON settings ([ref](https://stackoverflow.com/questions/54582361/vscode-terminal-shows-incorrect-python-version-and-path-launching-terminal-from)):
```bash
"terminal.integrated.inheritEnv": false,
```