Skip to content

Update Platform Architecture Overview & Markdown Generator #59

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 22 commits into from
Apr 7, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
662 changes: 427 additions & 235 deletions content/platform/developer_guide/architecture_overview.mdx

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: Add Examples to Commands
title: Adding Example Syntax
sidebar_position: 12
description: This guide provides detailed instructions for including command examples in the router endpoints of the OpenBB Platform.
keywords:
Expand All @@ -11,21 +11,23 @@ keywords:
- Examples
- Usage
- Parameters
- contributing
- requirements
---

import HeadTitle from "@site/src/components/General/HeadTitle.tsx";

<HeadTitle title="Add Examples to Commands - How-To | OpenBB Platform Docs" />
<HeadTitle title="Adding Example Syntax To Commands | OpenBB Platform Docs" />

Usage examples are defined in the router and are expected to provide working syntax, with descriptions for complex functions requiring many parameters.

> When a provider is not installed, its example will be excluded from `openapi.json` and Python docstrings
:::info FYI
When a provider is not installed, its example will be excluded from `openapi.json` and Python docstrings
:::

## Requirements

All router endpoints must have examples.
It is encouraged to include examples for every endpoint.

Submissions to our repository require:

- If any endpoint is excluded from the schema it only needs to contain a Python example.
- POST method examples should have both API and Python examples, unless they are excluded from the schema.
Expand All @@ -45,6 +47,8 @@ There are two models for defining examples, `APIEx` and `PythonEx`. `

`APIEx` is more structured aiming to be language agnostic - provides less freedom - while `PythonEx` gives more freedom to create complex examples.

### Imports

```python
from openbb_core.app.model.example import APIEx, PythonEx
```
Expand Down
4 changes: 2 additions & 2 deletions content/platform/developer_guide/contributing.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ The list below is intended to provide some guidance on what the general expectat
2. Documentation:
- All code contributions should come with relevant documentation, including the purpose of the contribution, how it works, and any changes it makes to existing functionalities.
- Update any existing documentation if your contribution alters the behavior of the OpenBB Platform.
- New router functions must have usage [examples](/platform/user_guides/add_command_examples) defined.
- New router functions must have usage [examples](command_examples) defined.

3. Code Quality:
- Your code should adhere strictly to the OpenBB Platform's coding standards and [conventions](architecture_overview).
Expand All @@ -50,5 +50,5 @@ The list below is intended to provide some guidance on what the general expectat
- Address any potential bottlenecks and ensure scalability.

6. Collaboration:
- Engage actively with the OpenBB development team to ensure that your contributions align with the platform's roadmap and standards.
- Engage actively with the OpenBB development team to ensure that your contributions align with the project's goals and standards.
- Welcome feedback and be open to making revisions based on reviews and suggestions from the community.
2 changes: 1 addition & 1 deletion content/platform/developer_guide/metadata.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import HeadTitle from '@site/src/components/General/HeadTitle.tsx';
## Overview

When data needs to be included in the output, but should not be included in the serialized results,
it can sent to the `extra` attribute of the [OBBject](obbject) command response by using the `AnnotatedResult` class.
it can sent to the `extra` attribute of the [OBBject](architecture_overview#obbject-class) command response by using the `AnnotatedResult` class.

A simple modification to the `transform_data` static method, in the provider's Fetcher class, is all that is required. The steps are outlined below.

Expand Down
188 changes: 0 additions & 188 deletions content/platform/developer_guide/obbject.mdx

This file was deleted.

16 changes: 10 additions & 6 deletions content/platform/installation.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ import HeadTitle from "@site/src/components/General/HeadTitle.tsx";

## General System Requirements

Most systems capable of running Python 3.9-3.12 will be compatible with the OpenBB Platform. A modern processor (five years or less), running an up-to-date operating system, with at least 4GB of RAM, is recommended. Maintaining the system with current patches ensures maximum compatibility. At a minimum, Windows and macOS should be:
Most systems capable of running Python `3.9.21-3.12` will be compatible with the OpenBB Platform. A modern processor (five years or less), running an up-to-date operating system, with at least 4GB of RAM, is recommended. Maintaining the system with current patches ensures maximum compatibility. At a minimum, Windows and macOS should be:

- Windows 10
- Mac OS Big Sur
Expand All @@ -57,17 +57,21 @@ It will handle the installation of Python, environment setup, and OpenBB package
:::danger
Users with v1.0.0 installations need to follow the steps below to update the version of OpenBB.

1. In Finder/Explorer, open the folder where it was installed - probably in a folder, named "OpenBB", at the root of the operating system user account.
1. In Finder/Explorer, open the folder where it was installed - probably in a folder, named "OpenBB", at the root of user home folder.
2. From the main installation folder, navigate into the subdirectory, "extensions/openbb_platform_installer".
3. Open, "pyproject.toml", in any text editor, and update line 21:
- From: openbb-core = "^1"
- To: openbb-core = ">=1.3.5"
3. Open, "pyproject.toml", in any text editor, and update two lines:
- Line 18:
- From: `python =">3.9,<3.13"`
- To: `python = ">=3.9.21,<3.13"`
- Line 21:
- From: `openbb-core = "^1"`
- To: `openbb-core = ">=1.4.4"`
4. Save the file, close it, and then run the "Update" shortcut.
:::

## Supported Environments

The OpenBB Platform is installed within a Python virtual environment. It is compatible with versions of Python between 3.9 and 3.12, inclusively. The method for creating the environment will be a matter of user preference, from the command line - [Conda](https://docs.conda.io/projects/miniconda/en/latest/miniconda-install.html), [venv](https://docs.python.org/3/library/venv.html), etc. - or in a code editor and IDE - [VS Code](https://code.visualstudio.com/docs/languages/python), [PyCharm](https://www.jetbrains.com/pycharm/), [Jupyter](https://jupyter.org/).
The OpenBB Platform is installed within a Python virtual environment. It is compatible with versions of Python between 3.9.21 and 3.12, inclusively. The method for creating the environment will be a matter of user preference, from the command line - [Conda](https://docs.conda.io/projects/miniconda/en/latest/miniconda-install.html), [venv](https://docs.python.org/3/library/venv.html), etc. - or in a code editor and IDE - [VS Code](https://code.visualstudio.com/docs/languages/python), [PyCharm](https://www.jetbrains.com/pycharm/), [Jupyter](https://jupyter.org/).

If you're interested in using the [Docker](/platform/installation#docker) container, skip ahead to the specific section [below](/platform/installation#docker).

Expand Down
6 changes: 3 additions & 3 deletions content/platform/settings_and_environment_variables.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ This is an example of how it might look after setup:
| table_style | dark | ["dark", "light"] | "The default color style to use with the OpenBB Charting Extension tables. Options are "dark", and "light"" |
| metadata | true | [true, false] | Enables or disables the collection of metadata which provides information about operations including arguments duration route and timestamp. Disabling this feature may improve performance in cases where contextual information is not needed, or when the additional computation time and storage space are a concern. |
| output_type | OBBject | ["OBBject", "dataframe", "numpy", "dict", "chart", "polars", "llm"] | Specifies the type of data the application will output when a command or endpoint is accessed. Note that choosing data formats only available in Python such as `dataframe`, `numpy`, or `polars` will render the application's API non-functional. |
| show_warnings | true | [true, false] | Enables or disables the display of warnings. |
| show_warnings | false | [true, false] | Enables or disables the display of warnings. |

:::note

Expand Down Expand Up @@ -161,6 +161,7 @@ The default will be ignored when the parameter is passed in the function call.
Environment variables are defined in a `.env` file. If this file does not exist, create it inside the same folder `user_settings.json` is located.

- `OPENBB_DEBUG_MODE`: enables verbosity while running the program
- `OPENBB_DEV_MODE`: applicable to the API; exposes, /system and /user, paths.
- `OPENBB_AUTO_BUILD`: enables automatic SDK package build on import
- `OPENBB_API_AUTH_EXTENSION`: specifies which API authentication extension to use
- `OPENBB_API_AUTH`: enables API authentication for command endpoints
Expand Down Expand Up @@ -276,8 +277,7 @@ Return a session object with the settings applied by:
- `openbb_core.provider.utils.helpers.get_async_requests_session`

:::tip
To use this configuration directly with the yFinance library, pass the session object, returned by `get_requests_session`,
to the function's `session` parameter.
Pass the session object, returned by `get_requests_session`, to use this configuration directly with the yFinance library.

```python
import yfinance as yf
Expand Down
2 changes: 1 addition & 1 deletion content/platform/user_guides/metadata.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import HeadTitle from '@site/src/components/General/HeadTitle.tsx';
## Overview

The OpenBB Platform returns metadata related to the command execution, as well as any returned from a Provider endpoint.
Both are stored in the `extra` attribute of the [OBBject](/platform/developer_guide/obbject.mdx) response object.
Both are stored in the `extra` attribute of the [OBBject](/platform/developer_guide/architecture_overview#obbject-class) response object.

It will always contain these elements:

Expand Down
Loading
Loading