Files
OpenBB/website
tehcoderer b90cbc98d8 Squashed commit of the following:
commit 70f70a81b4
Author: montezdesousa <79287829+montezdesousa@users.noreply.github.com>
Date:   Thu Aug 3 12:43:55 2023 +0100

    Hotfix/sdk py38 (#5279)

    * replace unsupported Annotated, MappingProxyType, is_annotated_dc

    * fix package builder

commit 61afffb1f5
Author: Diogo Sousa <montezdesousa@gmail.com>
Date:   Wed Aug 2 16:56:40 2023 +0100

    typing

commit 0b3b30eccc
Author: Diogo Sousa <montezdesousa@gmail.com>
Date:   Wed Aug 2 16:51:07 2023 +0100

    rename exception for better localization

commit 49fe650117
Author: Diogo Sousa <montezdesousa@gmail.com>
Date:   Wed Aug 2 16:43:54 2023 +0100

    update provider readme

commit 1e0a3c36c4
Author: Diogo Sousa <montezdesousa@gmail.com>
Date:   Wed Aug 2 16:43:19 2023 +0100

    update provider readme

commit 9a1b4a8fba
Author: Diogo Sousa <montezdesousa@gmail.com>
Date:   Wed Aug 2 16:42:02 2023 +0100

    update provider readme

commit 6b93a603dc
Author: Diogo Sousa <montezdesousa@gmail.com>
Date:   Wed Aug 2 16:37:54 2023 +0100

    update provider readme

commit 13d95452c3
Author: Diogo Sousa <montezdesousa@gmail.com>
Date:   Wed Aug 2 15:50:20 2023 +0100

    to follow the convention

commit e3d65b502f
Author: Diogo Sousa <montezdesousa@gmail.com>
Date:   Wed Aug 2 14:49:19 2023 +0100

    filter

commit cc5a334258
Author: Diogo Sousa <montezdesousa@gmail.com>
Date:   Wed Aug 2 14:42:14 2023 +0100

    cleanup filters

commit be864d01f3
Author: montezdesousa <79287829+montezdesousa@users.noreply.github.com>
Date:   Wed Aug 2 14:17:20 2023 +0100

    Feature/provider refactoring (#5266)

    * remove comment

    * replace registry description

    * black and add some todos

    * remove unused var

    * allow description and move provider to title

    * fix the data field descriptions

    * refactor globalnews

    * added `"limit"` to metadata descriptions

    * fix cpi command and refactor

    * refactored `AnalystEstimates`

    * add concat param

    * refactored `AvailableIndices` for `economy.available_indices`

    * sort and set index to date

    * place it inside exception

    * move literals to core

    * rename descriptions dict

    * add descriptions to cpi data

    * change description

    * black

    * refactored `CompanyOverview` for `stocks.fa.overview`

    * Updated `DATA_DESCRIPTIONS` in provider metadata

    * Updated `symbol` description in `DATA_DESCRIPTIONS`

    * fix stock_news alias

    * pass standard limit

    * fix stock news

    * fix to datframe

    * rebuild python interface

    * refactored `CryptoEOD` for `crypto.load`

    * added Field descriptions

    * fix polygon stock_news

    * fix stock_news data

    * ruff

    * refactored `DividendCalendar` for `stocks.fa.cal`

    * refactored `EarningsCalendar` for `stocks.fa.cal`

    * refactored `EarningsCallTranscript` for `stocks.fa.transcript`

    * refactored `ExecutiveCompensation` for `stocks.fa.comp`

    * first round, refactor registry, executor, map

    * ruff

    * Allow alias in the provider models for provider specific params

    * Updated stock news to use alias in query

    * small fixes

    * fix interface bug

    * black

    * exceptions and typing

    * ruff

    * fix docstring

    * sort providers

    * push static assets without docstrings

    * date Field and optional dates params in `CryptoEOD` for fmp and polygon

    * refactored `ForexEOD` for `forex.load`

    * add comment

    * refactored `ForexPairs` and added Polygon provider

    * removed `_price` models from fmp and polygon

    * Updated `economy.index` to use `MajorIndicesEOD`

    * removed `_price` from sdk models

    * refactored `MajorIndicesEOD` for `economy.index`

    * refactored `StockEOD` for `stocks.load`

    * regenerate sdk

    * ruff

    * fix bug with global_news

    * typing

    * add docstrings to registry map

    * update docstrings

    * add executor query arg

    * follow convention

    * docstring

    * inject provider interface instead

    * doc

    * safer this way

    * docs

    * add abstractmethod decorator

    * add explicit fetcher property model_name

    * remove mode_name prop

    * get model name from query params

    * force extra params or data to be optional

    * replace fetcher list by fetcher dict and black

    * explicit depps in prov interface

    * explicit depps in prov interface

    * no formatted creds

    * no formatted creds

    * dep injection

    * dep injection

    * private methods

    * just verify credentials

    * docstring

    * typing and cut doc

    * typing

    * typing

    * typing

    * no overkill

    * ruff

    * don't block if model not found, just warn

    * don't block if model not found, just warn

    * don't block if model not found, just warn

    * empty list if creds None

    * check creds before request

    * just return the data

    * typing

    * move query params

    * ruff

    * move queryparams

    * move queryparams

    * move queryparams

    * fix a bunch o polygon models

    * ruff

    * partial fix fmp models

    * ruff

    * refactor more fmps

    * create dict by alias

    * refactor more fmp endpoints

    * bug

    * add params to transform query

    * ruff

    * fix fmp bugs

    * has to be annotation

    * rewrite static

    * typing

    * append return type to map

    * support return for generic data type

    * remove return type for openbb provider

    * add todo

    * fix small fred typing error

    * add more return type info

    * better message

    * handle multiple types of data (the fetcher should declare them later)

    * add comment

    * ruff

    * handle returns with generic for now (check juan solution)

    * fix bug with generic

    * fix fmp fetchr dict

    * fill return type in the provider lib for docstrings

    * polygon stock news

    * Update economy_router.py (#5254)

    * remove return type stuff

    * adapt cpi and overview

    * rewrite python interface

    * fix to_dataframe

    * limit stocks eod output

    * rename method

    * mypy

    * mypy

    * mypy chart style

    * mypy provider

    * mypy ignores

    * mypy credentials

    * Added Statements Growth endpoints from FMP

    * account mypy fix

    * privatize account method

    * one more mypy

    * remove mypy ignore

    * rename private method

    * Linting

    * Docstring generation

    * Linting

    * move provider.py into __init__.py

    * add default to required_credentials -> None

    * refactored `KeyExecutives` for `stocks.fa.mgmt`

    * refactored `HistoricalEmployees` for `stocks.fa.emp`

    * provider docstring

    * docstring

    * refactored `HistoricalStockSplits` for `stocks.fa.split`

    * standardised date in stockeod

    * refactored ``InstitutionalOwnership` for `stocks.fa.own`

    * removed unused imports

    * add `check_fields=False` in `@validator`

    * historical dividens

    * remove unused helper

    * move single used helpers to where they are used

    * move single used helpers to where they are used

    * move single used helpers to where they are used

    * standardise date, vwap in crypto eod and forex eod

    * rename __commands__ to __extensions__

    * change coverage separator

    * the map cannot change sep

    * sry

    * sry again

    * remove comment

    * refactored `MajorIndicesConstituents` for `economy.const`

    * add some descriptions about provider

    * refactored `PriceTargetConsensus` for `stocks.fa.pt`

    * refactored `PriceTarget` for `stocks.fa.pta`

    * refactored `RevenueBusinessLine` for `stocks.fa.revseg`

    * change metadata file name

    * docstring

    * remove unecessary arg

    * ruff & black

    * refactored `RevenueGeographic` for `stocks.fa.revgeo`

    * refactored `RiskPremium` for `economy.risk`

    * refactored `SECFilings` for `stocks.dd.sec`

    * refactored `ShareStatistics` for `stocks.fa.shrs`

    * refactored `StockInsiderTrading` for `stocks.fa.ins`

    * peers

    * stock splits

    * refactored `KeyMetrics` for `stocks.fa.metrics`

    * refactored `StockMultiples` for `stocks.multiples`

    * refactor income statement

    * rebuild

    * fmp balance

    * added `StocksOwnership` to `stocks.fa.own`

    * added `InstitutionalOwnership` to `stocks.fa.ins_own`

    * refactored `StocksOwnership` for `stocks.fa.own`

    * cleanup

    * refactored `TreasuryRates` for `fixedincome.treasury`

    * reorder balance items

    * fix polygon bs

    * refactored `IncomeStatement` for `stocks.fa.balance`

    * refactored base and types

    * added static files

    * cleanup

    * cleanup

    * refactored `CashFlowStatement` for `stocks.fa.cash`

    * added `stocks/fa` static file

    * black and ruff

    ---------

    Co-authored-by: Pratyush Shukla <ps4534@nyu.edu>
    Co-authored-by: Igor Radovanovic <74266147+IgorWounds@users.noreply.github.com>

commit 2066d7d4be
Merge: fe1073da09 07537199af
Author: Henrique Joaquim <h.joaquim@campus.fct.unl.pt>
Date:   Wed Aug 2 05:37:20 2023 +0100

    Merge branch 'develop' into feature/openbb-sdk-v4

commit 07537199af
Author: montezdesousa <79287829+montezdesousa@users.noreply.github.com>
Date:   Tue Aug 1 17:27:59 2023 +0100

    Move hub api keys ts (#5267)

    * move hub api keys ts

    * json instead

    * update contributing.md

    * Update all_api_keys.json

    ---------

    Co-authored-by: DidierRLopes <dro.lopes@campus.fct.unl.pt>

commit ae91a3f9b9
Author: teh_coderer <me@tehcoderer.com>
Date:   Tue Aug 1 11:05:29 2023 -0500

    Hotfix  `economy/overview` rates displaying as dates (#5269)

    * fix: `economy/overview` rates displaying as dates

    * Fix Test

    ---------

    Co-authored-by: James Maslek <jmaslek11@gmail.com>

commit 3b5fc53cc7
Author: Danglewood <85772166+deeleeramone@users.noreply.github.com>
Date:   Tue Aug 1 06:41:21 2023 -0700

    Adds details/image for installing C++ Build Tools (#5268)

    * Adds details/image for installing C++ Build Tools

    * Update installation_updates.md with screenshots

    * Update installation_updates.md

    Screenshots for MS C++ Build Tools

commit fe1073da09
Author: Diogo Sousa <montezdesousa@gmail.com>
Date:   Tue Aug 1 12:29:42 2023 +0100

    only allow setup for allowed system fields

commit c8f82e1f8f
Author: Diogo Sousa <montezdesousa@gmail.com>
Date:   Tue Aug 1 12:04:16 2023 +0100

    reorder system settings attrs

commit 21c69a510f
Merge: 379a5518fa d212a8e270
Author: Theodore Aptekarev <aptekarev@gmail.com>
Date:   Mon Jul 31 20:17:30 2023 +0300

    Merge branch 'develop' into feature/openbb-sdk-v4

commit d212a8e270
Author: Danglewood <85772166+deeleeramone@users.noreply.github.com>
Date:   Mon Jul 31 09:05:22 2023 -0700

    hotfix/gdp-units - better GDP units (#5262)

    * better GDP units

    * mypy

    * remove not needed dict

    * test_oecd_view.py

    * test_oecd_model.py

commit dc30ab3d36
Author: teh_coderer <me@tehcoderer.com>
Date:   Fri Jul 28 21:13:42 2023 -0500

    Hotfix/ locking when deploying streamlit app (#5261)

    * fix locking when deploying streamlit app

    * Update streamlit_run.py

    * Update streamlit_run.py

commit 379a5518fa
Author: hjoaquim <h.joaquim@campus.fct.unl.pt>
Date:   Fri Jul 28 10:00:39 2023 +0100

    small comment on show() implementation

commit 849e6134ee
Merge: 27e1728027 73348c0872
Author: Theodore Aptekarev <aptekarev@gmail.com>
Date:   Thu Jul 27 19:23:10 2023 +0300

    Merge branch 'develop' into feature/openbb-sdk-v4

commit 27e1728027
Merge: afe4c480a2 41d1359202
Author: Henrique Joaquim <h.joaquim@campus.fct.unl.pt>
Date:   Thu Jul 27 15:04:19 2023 +0100

    Merge branch 'develop' into feature/openbb-sdk-v4

commit afe4c480a2
Author: Diogo Sousa <montezdesousa@gmail.com>
Date:   Wed Jul 26 14:33:37 2023 +0100

    fix comment

commit 531fa104c8
Author: Diogo Sousa <montezdesousa@gmail.com>
Date:   Wed Jul 26 14:32:00 2023 +0100

    rename method and add description

commit cc1a84b4d0
Author: Diogo Sousa <montezdesousa@gmail.com>
Date:   Wed Jul 26 13:15:55 2023 +0100

    change method description

commit ff31d9ab87
Author: Diogo Sousa <montezdesousa@gmail.com>
Date:   Wed Jul 26 12:52:54 2023 +0100

    check sdk token expiration on login
2023-08-04 14:44:09 -04:00
..
2023-08-04 14:44:09 -04:00
2023-04-25 18:53:51 +00:00
2023-03-28 16:31:45 -04:00
2022-11-25 17:19:08 -05:00
2022-11-22 16:47:03 +00:00
2022-11-22 16:47:03 +00:00
2023-04-13 10:34:15 -04:00
2023-03-23 23:16:46 -04:00
2022-11-22 16:47:03 +00:00

OpenBB Documentation Website

This repository contains the source code for the OpenBB Documentation Website.

The website was built using Docusaurus, a modern static website generator and TailwindCSS as styling solution. It uses algolia search for the search bar. The final website can be found at https://docs.openbb.co.

Folder Structure

website
├── content # Markdown files
| ├── sdk # SDK markdown files
| ├── bot # bot markdown files
| └── terminal # Terminal markdown files
├── old_content # previous terminal documentation; required to get the examples for terminal reference
├── src # react stuff for website
├── static # Static files
├── generate_sdk_markdown.py # Script to generate markdown files for SDK
└── generate_terminal_markdown.py # Script to generate markdown files for Terminal

Markdown files

The markdown files are used to generate the website. The markdown files are located in the content folder. The markdown files are generated using the generate_sdk_markdown.py and generate_terminal_markdown.py scripts. The markdown files are generated from the docstrings in the SDK and Terminal code. Files inside content/sdk/reference and content/terminal/reference should not be changed manually because they are generated automatically on every commit.

Syntax sugar

Code blocks

Code blocks are generated using the default markdown syntax:

```python
print("Hello World")
```

To generate a dynamic date for a certain code block (useful for options examples that need to have a valid date), you can use 2022-07-29 as a placeholder. The script will replace it with the third friday of the next month.

/op oichart ticker:AMD expiry:2022-07-29

Available options

This is great for huge lists. It opens a popup that contains the list and the search bar, so you can easily find what you are looking for. Everything is virtualized, so it's always fast no matter how many items you have. Check crypto page for a demo of this component.

import AvailableOptions from "@site/src/components/General/AvailableOptions";

<AvailableOptions
label="Exchanges"
allOptions={[
"aax",
"ascendex",
"bequant",
"bibox",
"bigone",
"binance",
"binancecoinm",
"binanceus",
"binanceusdm",
"bit2c",
"bitbank",
"bitbay",
"bitcoincom",
"bitfinex",
"bitfinex2",
"bitflyer",
"bitforex",
"bitget",
"bithumb",
"bitmart",
"bitmex",
"bitopro",
"bitpanda",
"bitrue",
"bitso",
"bitstamp",
"bitstamp1",
"bittrex",
"bitvavo",
]}
/>

Run locally

Prerequisites

  • Node.js >= 16.13.0 To check if you have Node.js installed, run this command in your terminal:
node --version # should be v16.13.0 or higher

Install dependencies

npm install

Start development server

npm start

This command starts a local development server and open up a browser window in http://localhost:3000. Most changes are reflected live without having to restart the server.

Build

npm run build

This command generates static content into the build directory and can be served using any static contents hosting service. We use Github Pages to host our website. It's deployed in the gh-pages branch.

Run tests

pytest tests/website --autodoc

If tests are run locally, the --autodoc flag is required, otherwise tests will be skipped.

To install necessary dependencies for tests, run poetry install -E doc in the root directory of the repository.

Notes

iFrame

We are detecting whether the website is loaded inside an iframe. If it is, we are hiding the header and footer. This is done to have a better integration with out hub website.

Contributing

We welcome contributions to the OpenBB Documentation Website.


DEPRECATED - OLD README

Hugo Server

The current features can be found in OpenBB Terminal Features.

Table of Contents

  1. Install Hugo
  2. Run Locally
  3. Adding Features

Install Hugo

Install Hugo.

Run Locally

Go into website directory with:

cd website

And run:

hugo server -D

If everything is working well, the following should appear:

13:58 $ hugo server -D
Start building sites …
hugo v0.87.0+extended darwin/amd64 BuildDate=unknown

                   | EN
-------------------+------
  Pages            | 853
  Paginator pages  |   0
  Non-page files   |   1
  Static files     | 111
  Processed images |   4
  Aliases          |   0
  Sitemaps         |   1
  Cleaned          |   0

Built in 14912 ms
Watching for changes in /Users/DidierRodriguesLopes/Documents/git/OpenBBTerminal/website/{archetypes,assets,content,data,static,themes}
Watching for config changes in /Users/DidierRodriguesLopes/Documents/git/OpenBBTerminal/website/config.toml
Environment: "development"
Serving pages from memory
Running in Fast Render Mode. For full rebuilds on change: hugo server --disableFastRender
Web Server is available at http://localhost:1313/ (bind address 127.0.0.1)
Press Ctrl+C to stop

And you should be able to access your local version at http://localhost:1313/.

This will be important for the addition of features to the Hugo Server.

Adding Features

Structure

This is the structure that the documentation follows:

website/content/_index.md
               /stocks/_index.md
                      /load/_index.md
                      /candle/_index.md
                      /discovery/_index.md
                                /ipo/_index.md
                                    /...
                                /...
                      /...
               /cryptocurrency/_index.md
                              /chart/_index.md
                              /defi/_index.md
                                   /borrow/_index.md
                                   /...
                              /...
               /...
               /common/_index.md
                      /technical_analysis/_index.md
                                         /ema/_index.md
                                         /...
                      /...

Note that the common folder holds features that are common across contexts, e.g. technical analysis can be performed on both stocks or crytpo.

New Feature

To add a new command, there are two main actions that need to be done:

  1. Create a directory with the name of the command and a _index.md file within. Examples:

    • When adding ipo, since this command belongs to context stocks and category discovery, we added a ipo folder with a _index.md file within to website/content/stocks/discovery.
    • When adding candle, since this command belongs to context stocks, we added a candle folder with a _index.md file within to website/content/stocks/.
  2. The _index.md file should have the output of the command -h followed by a screenshot example (with white background) of what the user can expect. Note that you can now drag and drop the images while editing the readme file on the remote web version of your PR branch. Github will create a link for it with format (https://user-images.githubusercontent.com//.file_format).

Example:


usage: ipo [--past PAST_DAYS] [--future FUTURE_DAYS]

Past and future IPOs. [Source: https://finnhub.io]

  • --past : Number of past days to look for IPOs. Default 0.
  • --future : Number of future days to look for IPOs. Default 10.

<IMAGE HERE - Use drag and drop hint mentioned above>


  1. Update the Navigation bar to match the content you've added. This is done by adding 2 lines of code to website/data/menu/, i.e. a name and a ref. Example:
---
main:
  - name: stocks
    ref: "/stocks"
    sub:
      - name: load
        ref: "/stocks/load"
      - name: candle
        ref: "/stocks/candle"
      - name: discovery
        ref: "/stocks/discovery"
        sub:
          - name: ipo
            ref: "/stocks/discovery/ipo"
          - name: map
            ref: "/stocks/discovery/map"