Files
OpenBB/openbb_sdk/sdk/provider
teh_coderer 6a9308c3e7 Feature/sdk v4 pydantic v2 (#5458)
* init

* Update provider_interface.py

* docstring

* pydantic v2

* Update __init__.py

* build package v2 support

* `alises` to `aliases`

Co-authored-by: montezdesousa <79287829+montezdesousa@users.noreply.github.com>

* `alises` to `aliases`

Co-authored-by: montezdesousa <79287829+montezdesousa@users.noreply.github.com>

* `alises` to `aliases`

Co-authored-by: montezdesousa <79287829+montezdesousa@users.noreply.github.com>

* updates

* Update registry.py

* validate_arguments -> validate_call

* update terminal classes

* response_model_by_alias = False

* query_params by alias

* Update major_indices_constituents.py

* add alias to Query in `provider_interface`

* yfinance

* build package, add param defaults and correct `OBBject` results type

* fix cpi validation errors

* Update risk_premium.py

* fix `forex_pairs` active query param annotation, set default when only 1 provider

* fix and refactor intrinio `options_chains`

* Update poetry.lock

* fix benzinga news, build package, add intrinio fred_historical fetcher

* Update extension_map.json

* ruff

* Update unit_test_generator.py

* updates

* add `default=None` on Optional fields

* `parse_obj` -> `model_validate`

* add alias to dup fields on providers with `__alias_dict__`, fix `test_generate_model_docstring`

* Update package_builder.py

* fix validation errors, fix tests

* tests http

* `fred_historical` record

* Update test_intrinio_fetchers.py

* Update test_intrinio_fetchers.py

* Update test_intrinio_fetchers.py

* Update available_indices.py

* Update stock_historical.py

* build package

* build package without optional

* change `SystemSettings` -> `MockSystemSettings` in `test_system_settings.py`

* `openbb_figure.py`/`backend.py` terminal changes  , update deps/lock files

* `linearmodels>4.26`  auto installs `setuptools-scm` which cause error messages

* clean up

* `dev_install.py` for local development

* ruff

* dup `# noqa`

* build

* Update bitquery_model.py

* records

* rec

* f

* worky?

* update `integration_test_generator.py` and `unit_test_generator.py`

* renamed test to tests in file

* fix import due to change in file name

---------

Co-authored-by: Pratyush Shukla <ps4534@nyu.edu>
Co-authored-by: montezdesousa <79287829+montezdesousa@users.noreply.github.com>
2023-09-27 09:40:07 +01:00
..
2023-07-24 16:50:04 +02:00
2023-09-27 09:40:07 +01:00

Table of contents

Provider

The OpenBB Provider aims to give a coherent access to financial data providers by introducing standardization procedures.

What is Data Standardization?

It's like teaching everyone to speak the same language with their data so we can understand and compare it easily.

Think of it as a part of:

Data normalization, a bigger way of organizing data.

What We Do:

  • Match Column Names and Formats: Like making sure everyone calls a "closing price" the same thing.

  • For instance: Some might say "Close", others might say "c". We make sure everyone uses one term. Unify Date and Time Styles: Like having everyone use the same calendar format.

Example: Whether it's "YYYY-MM-DD" or "MM-DD-YYYY", we pick one style for everyone.

What We Don’t Do:

  • Cleaning Data: We don't act like data detectives and remove mistakes from what providers give us.

  • Change & Combine Data: Tweaking data or mixing data from different places.

Key Elements

  • QueryParams : The input model for a particular query. To load stock market data, we would have StockQueryParams, which would have fields like symbol, start_date, and end_date. You can find the standard query params inside the standard_models directory.
  • Data : The output model of a particular query. Stock market data would be StockPriceData and have fields such as Open, High, Low, Close, and Volume. You can find the standard data models inside the standard_models directory.
  • Fetcher : Class containing a set of methods to receive query parameters, extract data and transform it. This class is responsible for implementing the standardization procedures.
  • Provider : Entry point class for each provider extension. Contains information about the provider, it's required credentials and available fetchers.
  • RegistryLoader : Loads the registry with the installed provider extensions.
  • Registry : Maintains a registry of provider extensions installed.
  • RegistryMap : Stores the complete characterization of each provider. It centralizes information like required credentials, standardized and extra query parameters/data by provider.
  • QueryExecutor : Executes a given query, routing it to the respective provider and fetcher.

Installation

To install the provider, run the following command in this folder:

pip install .