Skip to content
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

Terminal to Workspace #54

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
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
Prev Previous commit
Next Next commit
update Platform file names
Meg1211 committed Jan 23, 2025
commit fd775957d8b8e6785026b360b320de9597e1b024
2 changes: 1 addition & 1 deletion content/cli/installation.md
Original file line number Diff line number Diff line change
@@ -86,7 +86,7 @@ Welcome to OpenBB Platform CLI v1.0.0

Follow the instructions [here](/platform/installation#source) to clone the GitHub repo and install the OpenBB Platform from the source code.

Next, navigate into the folder: `~/OpenBBTerminal/openbb_platform`
Next, navigate into the folder: `~/OpenBB/openbb_platform`

:::tip
The Python environment should have `poetry` installed.
4 changes: 2 additions & 2 deletions content/platform/developer_guide/dependency_management.mdx
Original file line number Diff line number Diff line change
@@ -29,11 +29,11 @@ import HeadTitle from '@site/src/components/General/HeadTitle.tsx';
Do not run these commands in an already-installed OpenBB Platform environment. Do not run both `pip` and `poetry`.
:::

- **pip**: `pip install -e OpenBBTerminal/openbb_platform/platform/core`
- **pip**: `pip install -e OpenBB/openbb_platform/platform/core`

or

- **poetry**: `poetry install OpenBBTerminal/openbb_platform/platform/core`
- **poetry**: `poetry install OpenBB/openbb_platform/platform/core`

### Using Poetry

2 changes: 1 addition & 1 deletion content/platform/developer_guide/standardization.mdx
Original file line number Diff line number Diff line change
@@ -37,7 +37,7 @@ Standardizing provider query parameters and response data enhances the user expe
- Transparently defined schemas for the data and query parameters.
- Outputs from multiple sources are comparable with each other and easily interchanged.

The standard models are all defined in the `/OpenBBTerminal/openbb_platform/core/openbb_core/provider/standard_models/` [directory](https://github.com/OpenBB-finance/OpenBBTerminal/tree/main/openbb_platform/core/openbb_core/provider/standard_models).
The standard models are all defined in the `/OpenBB/openbb_platform/core/openbb_core/provider/standard_models/` [directory](https://github.com/OpenBB-finance/OpenBBTerminal/tree/main/openbb_platform/core/openbb_core/provider/standard_models).

### What Is A Standard Model?

6 changes: 3 additions & 3 deletions content/platform/user_guides/add_data_provider_extension.mdx
Original file line number Diff line number Diff line change
@@ -66,12 +66,12 @@ The `__init__.py` file where models are mapped to the router is under, `/openbb_

To get started:

- Unpack the downloaded [zip](ttps://github.com/OpenBB-finance/OpenBBTerminal/files/14519701/provider_extension_template.zip) file.
- Unpack the downloaded [zip](ttps://github.com/OpenBB-finance/OpenBB/files/14519701/provider_extension_template.zip) file.

- If working with a cloned GitHub repo, the folder is:

```console
~/OpenBBTerminal/openbb_platform/providers
~/OpenBB/openbb_platform/providers
```

- Rename everything, "template", to suit. File names, models, import statements, docstrings.
@@ -137,7 +137,7 @@ template = "openbb_template:template_provider"

The last line (poetry.plugins) maps to the provider defined in the `__init__.py` file.

Additionally, for local extensions, you can add this line in the `LOCAL_DEPS` variable in the `dev_install.py` file, located in `~/OpenBBTerminal/openbb_platform/`:
Additionally, for local extensions, you can add this line in the `LOCAL_DEPS` variable in the `dev_install.py` file, located in `~/OpenBB/openbb_platform/`:

```toml
# If this is a community dependency, add this under "Community dependencies",
Original file line number Diff line number Diff line change
@@ -224,7 +224,7 @@ Let's get on with the fun stuff and start building!
The first step is to create a new file in the provider extension folder:

```console
~/OpenBBTerminal/openbb_platform/providers/alpha_vantage/openbb_alpha_vantage/models
~/OpenBB/openbb_platform/providers/alpha_vantage/openbb_alpha_vantage/models
```

We will call this file: `historical_eps.py`
@@ -559,7 +559,7 @@ Adding tests doesn't take a lot of effort. In most cases, copying and pasting fr
Unit tests are located in the provider extension folder.

```console
~/OpenBBTerminal/openbb_platform/providers/alpha_vantage/tests
~/OpenBB/openbb_platform/providers/alpha_vantage/tests
```

There will be one test file dedicated to testing each fetcher in the provider extension. Our file is:
@@ -637,7 +637,7 @@ Step 7 is done.
Integration tests are even easier to add here, we just need to add a set of parameters for the new provider to the existing test. These tests are located in the `extensions` folder, where the routers are, under `integration`.

```console
~/OpenBBTerminal/openbb_platform/extensions/equity/integration
~/OpenBB/openbb_platform/extensions/equity/integration
```

There are two files here, one for the Python interface, and the other for the Fast API.
@@ -810,7 +810,7 @@ When preparing to commit changes to the local branch, only add the files directl

### Install Pre-Commit Hooks

The pre-commit hooks will run the testing suite locally before the commit is made. Install them from the root of the GitHub project folder, `OpenBBTerminal`.
The pre-commit hooks will run the testing suite locally before the commit is made. Install them from the root of the GitHub project folder, `OpenBB`.

```console
pre-commit install
36 changes: 18 additions & 18 deletions content/platform/user_guides/add_endpoint_to_existing_provider.mdx
Original file line number Diff line number Diff line change
@@ -131,7 +131,7 @@ The rule must be clearly communicated and each provider's output should be verif
We're going to map this new endpoint in the interface to, `obb.currency.snapshots()`. We'll name the model accordingly, `CurrencySnapshots`, and create a file, `currency_snapshots.py`. The file should be created here:

```console
~/OpenBBTerminal/openbb_platform/core/openbb_core/provider/standard_models/
~/OpenBB/openbb_platform/core/openbb_core/provider/standard_models/
```

The first line of the file should be a docstring, the second line should be empty, and the import statements follow.
@@ -312,7 +312,7 @@ Sample output data from the source is pasted below, and we can see that there ar
We need to create a new file in the FMP provider extension. This will have the same name as our standard model.

```console
~/OpenBBTerminal/openbb_platform/providers/fmp/openbb_fmp/models/currency_snapshots.py
~/OpenBB/openbb_platform/providers/fmp/openbb_fmp/models/currency_snapshots.py
```

The first line in the file will always be a docstring, with the import statements beginning below an empty line.
@@ -499,7 +499,7 @@ class FMPCurrencySnapshotsFetcher(

The last four code blocks combined are the entire contents of the new provider model file.

Next, open `~/OpenBBTerminal/openbb_platform/providers/fmp/openbb_fmp/__init__.py`, import the new model, and map it in the Provider class.
Next, open `~/OpenBB/openbb_platform/providers/fmp/openbb_fmp/__init__.py`, import the new model, and map it in the Provider class.

Step 3 is now done.

@@ -510,7 +510,7 @@ Step 3 is now done.
To use our new function, we need to create a router command. The currency router is located here:

```python
~/OpenBBTerminal/openbb_platform/extensions/currency/openbb_currency/currency_router.py
~/OpenBB/openbb_platform/extensions/currency/openbb_currency/currency_router.py
```

It's as simple as copying and pasting the function above and modifying details to suit.
@@ -583,7 +583,7 @@ We'll need to create a unit test for the FMP provider, and then integration test
This is located in the `openbb-fmp` extension:

```console
~/OpenBBTerminal/openbb_platform/providers/fmp/tests/test_fmp_fetchers.py
~/OpenBB/openbb_platform/providers/fmp/tests/test_fmp_fetchers.py
```

- Import the new fetcher with the rest of the imports (keep them alphabetically sorted).
@@ -608,7 +608,7 @@ def test_fmp_currency_snapshots_fetcher(credentials=test_credentials):
This will generate a new file:

```console
~/OpenBBTerminal/openbb_platform/providers/fmp/tests/record/test_fmp_currency_snapshots_fetcher.yaml
~/OpenBB/openbb_platform/providers/fmp/tests/record/test_fmp_currency_snapshots_fetcher.yaml
```

Check the file for any obvious errors, like a bad HTTP request status code.
@@ -622,7 +622,7 @@ The Python interface and Fast API each require a new integration test. Again, em
Open the file below, and go to the last test in the file.

```console
~/OpenBBTerminal/openbb_platform/extensions/currency/integration/test_currency_api.py
~/OpenBB/openbb_platform/extensions/currency/integration/test_currency_api.py
```

We can copy this one:
@@ -675,7 +675,7 @@ def test_currency_snapshots(params, headers):
The `@parameterize` section can be copied directly to the Python integration test.

```console
~/OpenBBTerminal/openbb_platform/extensions/currency/integration/test_currency_python.py
~/OpenBB/openbb_platform/extensions/currency/integration/test_currency_python.py
```

```python
@@ -729,19 +729,19 @@ Fix all items, and valid fixes for `pylint` can be disabling on that line. It wo

Here are all the files we touched in this process:

- `/OpenBBTerminal/openbb_platform/core/openbb_core/provider/standard_models/currency_snapshots.py`
- `/OpenBBTerminal/openbb_platform/providers/fmp/openbb_fmp/models/currency_snapshots.py`
- `/OpenBBTerminal/openbb_platform/providers/fmp/tests/test_fmp_fetchers.py`
- `/OpenBBTerminal/openbb_platform/providers/fmp/tests/record/test_fmp_currency_snapshots_fetcher.yaml`
- `/OpenBBTerminal/openbb_platform/extensions/currency/openbb_currency/currency_router.py`
- `/OpenBBTerminal/openbb_platform/extensions/currency/integration/test_currency_api.py`
- `/OpenBBTerminal/openbb_platform/extensions/currency/integration/test_currency_python.py`
- `/OpenBBTerminal/openbb_platform/openbb/assets/module_map.json`
- `/OpenBBTerminal/openbb_platform/openbb/package/currency.py`
- `/OpenBB/openbb_platform/core/openbb_core/provider/standard_models/currency_snapshots.py`
- `/OpenBB/openbb_platform/providers/fmp/openbb_fmp/models/currency_snapshots.py`
- `/OpenBB/openbb_platform/providers/fmp/tests/test_fmp_fetchers.py`
- `/OpenBB/openbb_platform/providers/fmp/tests/record/test_fmp_currency_snapshots_fetcher.yaml`
- `/OpenBB/openbb_platform/extensions/currency/openbb_currency/currency_router.py`
- `/OpenBB/openbb_platform/extensions/currency/integration/test_currency_api.py`
- `/OpenBB/openbb_platform/extensions/currency/integration/test_currency_python.py`
- `/OpenBB/openbb_platform/openbb/assets/module_map.json`
- `/OpenBB/openbb_platform/openbb/package/currency.py`

### Install Pre-Commit Hooks

The pre-commit hooks will run the testing suite locally before the commit is made. Install them from the root of the GitHub project folder, `OpenBBTerminal`.
The pre-commit hooks will run the testing suite locally before the commit is made. Install them from the root of the GitHub project folder, `OpenBB`.

```console
pre-commit install
2 changes: 1 addition & 1 deletion content/platform/user_guides/add_toolkit_extension.mdx
Original file line number Diff line number Diff line change
@@ -41,7 +41,7 @@ The folder does not have to be kept with the OpenBB code, and could be its own G
For demonstration purposes, we'll unpack the ZIP file template with the rest of the OpenBB extensions:

```console
~/OpenBBTerminal/openbb_platform/extensions/dashboards
~/OpenBB/openbb_platform/extensions/dashboards
```

### Add Dependencies
2 changes: 1 addition & 1 deletion content/platform/user_guides/extensions.mdx
Original file line number Diff line number Diff line change
@@ -50,7 +50,7 @@ A couple of notable differences between data and toolkit extension are:
- In the OpenBB GitHub repo, extensions are all located under:

```console
~/OpenBBTerminal/openbb_platform/extensions
~/OpenBB/openbb_platform/extensions
```

- An additional folder housing integration tests, with the `tests` folder staying empty.