diff --git a/content/odp/cli/installation.md b/content/odp/cli/installation.md index 0fb3f47ed0..4d91743a82 100644 --- a/content/odp/cli/installation.md +++ b/content/odp/cli/installation.md @@ -22,7 +22,7 @@ import HeadTitle from '@site/src/components/General/HeadTitle.tsx'; ODP CLI is a wrapper around the [OpenBB Python Package](/odp/python), and should be installed along side an existing OpenBB installation. -- A Python virtual environment with a version between 3.9 and 3.11, inclusive, is required. +- A Python virtual environment with a version between 3.10 and 3.14, inclusive, is required. Please refer to the [Python install documentation](/odp/python/installation) for instructions and more information. diff --git a/content/odp/python/developer/how-to/annotated_results.mdx b/content/odp/python/developer/how-to/annotated_results.mdx index d4751d2e87..1cfba3834a 100644 --- a/content/odp/python/developer/how-to/annotated_results.mdx +++ b/content/odp/python/developer/how-to/annotated_results.mdx @@ -1,6 +1,6 @@ --- title: Annotated Results -sidebar_position: 6 +sidebar_position: 4 description: This guide provides instructions for returning extra response metadata from Provider extension models. Use this class to include important citations, credits, or other dictionary-like items that should not be included in table or chart data. keywords: - ODP diff --git a/content/odp/python/developer/how-to/country_input.mdx b/content/odp/python/developer/how-to/country_input.mdx new file mode 100644 index 0000000000..ab8fc1da46 --- /dev/null +++ b/content/odp/python/developer/how-to/country_input.mdx @@ -0,0 +1,86 @@ +--- +title: Country Input Component +sidebar_position: 1 +description: This guide describes the implementation of ISO 3166 as a reusable input component, and how to use it for input validation or output transoformations. +keywords: +- country +- countries +- ISO 3166 +- input +- develop +- odp +- python +--- + +import HeadTitle from '@site/src/components/General/HeadTitle.tsx'; + + + +The `Country` class is a special type of string object. It behaves and evaluates like a string, but is extended with input validators and output formatters. Use this class for functions with a 'country' parameter, or to convert two and three-letter country codes, display labels, and names. All countries are spelled with English letters and exclude UTF characters such as umlauts. + +## Import + +```python +from openbb_core.provider.utils.country_utils import Country +``` + +## Usage + +The `__repr__` of class instance will be the 2-letter country code. + +```python +>>> Country("United States") +'US' +>>> Country("gb").name +'United Kingdom' +>>> Country("hk").alpha_3 +'HKG' +>>> Country("United States") == 'US' +True +>>> c = Country("united_states") +>>> isinstance(c, str) +True +>>> c.alpha_2 +'US' +>>> c.alpha_3 +'USA' +>>> c.name +'United States' +>>> c.groups +['G7', 'G20', 'NATO', 'OECD'] +>>> c.is_member_of("G7") +True +``` + +### Properties + +- **alpha_2** : str - ISO 3166-1 alpha-2 code. +- **alpha_3** : str - ISO 3166-1 alpha-3 code. +- **name** : str - The country's display name, in English. +- **numeric**: str - ISO 3166-1 numeric code. +- **groups**: list[str] - List of membership groups the country belongs to. + +### Methods + +- **is_member_of(self, group: str) -> bool**: Check if a country is a member of a specific group. + +## Updating Definitions + +If the definitions have become stale, you can refresh them in the environment with the update script. + +```sh +pip install pycountry +python -m openbb_core.provider.utils.update_country_data +``` + +## Sources + +- ISO 3166-1: https://en.wikipedia.org/wiki/ISO_3166-1 +- pycountry: https://github.com/pycountry/pycountry +- G7: https://en.wikipedia.org/wiki/G7 +- G20: https://en.wikipedia.org/wiki/G20 +- EU: https://european-union.europa.eu/principles-countries-history/eu-countries_en +- NATO: https://www.nato.int/en/about-us/organization/nato-member-countries +- OECD: https://en.wikipedia.org/wiki/OECD +- OPEC: https://en.wikipedia.org/wiki/OPEC +- BRICS: https://en.wikipedia.org/wiki/BRICS diff --git a/content/odp/python/developer/how-to/deprecating_endpoints.mdx b/content/odp/python/developer/how-to/deprecating_endpoints.mdx index c0d881db4d..83b3928a11 100644 --- a/content/odp/python/developer/how-to/deprecating_endpoints.mdx +++ b/content/odp/python/developer/how-to/deprecating_endpoints.mdx @@ -1,6 +1,6 @@ --- title: Deprecating Endpoints -sidebar_position: 6 +sidebar_position: 7 description: This guide provides detailed instructions on how to deprecate an endpoint in the ODP Python Package. keywords: - ODP diff --git a/content/odp/python/developer/how-to/disabling_output_validation.mdx b/content/odp/python/developer/how-to/disabling_output_validation.mdx index 436df6bb8c..8ceb8fb5bd 100644 --- a/content/odp/python/developer/how-to/disabling_output_validation.mdx +++ b/content/odp/python/developer/how-to/disabling_output_validation.mdx @@ -1,6 +1,6 @@ --- title: Disabling Output Validation -sidebar_position: 3 +sidebar_position: 6 description: This page provides instructions for disabling output validation, when defining a new router function. keywords: - Validation diff --git a/content/odp/python/developer/how-to/dynamic_command_execution.mdx b/content/odp/python/developer/how-to/dynamic_command_execution.mdx index cf53c975dd..c0fc37bc3c 100644 --- a/content/odp/python/developer/how-to/dynamic_command_execution.mdx +++ b/content/odp/python/developer/how-to/dynamic_command_execution.mdx @@ -1,6 +1,6 @@ --- title: Dynamic Command Execution -sidebar_position: 2 +sidebar_position: 7 description: This guide provides detailed instructions on how to execute commands dynamically in the OpenBB Python Package. keywords: - ODP diff --git a/content/odp/python/developer/how-to/examples.mdx b/content/odp/python/developer/how-to/examples.mdx index ffded7cbb7..09bc26e2e9 100644 --- a/content/odp/python/developer/how-to/examples.mdx +++ b/content/odp/python/developer/how-to/examples.mdx @@ -1,6 +1,6 @@ --- title: Function Examples -sidebar_position: 2 +sidebar_position: 4 description: This page explains how to add examples and code snippets to API and Python endpoints. keywords: - ODP diff --git a/content/odp/python/developer/how-to/exchange_input.mdx b/content/odp/python/developer/how-to/exchange_input.mdx new file mode 100644 index 0000000000..e9210a3d07 --- /dev/null +++ b/content/odp/python/developer/how-to/exchange_input.mdx @@ -0,0 +1,68 @@ +--- +title: Exchange Input Component +sidebar_position: 2 +description: This guide describes the implementation of ISO 10383 as a reusable input component, and how to use it for input validation or output transoformations. +keywords: +- exchange +- MIC +- market +- ISO 10383 +- input +- develop +- odp +- python +--- + +import HeadTitle from '@site/src/components/General/HeadTitle.tsx'; + + + +The `Exchange` class is a special type of string object. It behaves and evaluates like a string, but is extended with input validators and output formatters. + +Use this class for functions with an 'exchange' parameter, or to convert between MICs, exchange acronyms or names. + +## Import + +```python +from openbb_core.provider.utils.exchange_utils import Exchange +``` + +## Usage + +Initialize the class with any of the accepted inputs: + +- ISO 10383 MIC codes (e.g., "XNAS", "XNYS") +- Exchange acronyms (e.g., "NASDAQ", "NYSE") +- Full exchange names (e.g., "New York Stock Exchange") +- lower_snake_case names (e.g., "new_york_stock_exchange") + +```python +>>> e = Exchange("nasdaq") +>>> str(e) +'XNAS' +>>> e.mic +'XNAS' +>>> e.acronym +'NASDAQ' +>>> e.name +'NASDAQ - ALL MARKETS' +``` + +### Properties + +- **mic** : str - ISO 10383 Market Identifier Code. +- **acronym** : str - Exchange acronym/short name. +- **name** : str - Full exchange name. + + +## Updating Definitions + +If the definitions have become stale, you can refresh them in the environment with the update script. + +```sh +python -m openbb_core.provider.utils.update_exchange_data +``` + +## Source + +- https://www.iso20022.org/market-identifier-codes diff --git a/content/odp/python/developer/how-to/http_requests.mdx b/content/odp/python/developer/how-to/http_requests.mdx index f9e9892522..cf5295874c 100644 --- a/content/odp/python/developer/how-to/http_requests.mdx +++ b/content/odp/python/developer/how-to/http_requests.mdx @@ -1,6 +1,6 @@ --- title: HTTP Requests -sidebar_position: 1 +sidebar_position: 3 description: This guide outlines OpenBB processes for making HTTP requests synchronously and asynchronously. Using the helpers will keep the codebase leaner and easier to maintain by eliminating duplicate processes. Anyone can build effective and efficient data fetchers, this guide outlines how to import and implement either type of request into any fetcher. keywords: - OpenBB Platform diff --git a/content/odp/python/developer/how-to/index.md b/content/odp/python/developer/how-to/index.md index 683f03445b..d7611190eb 100644 --- a/content/odp/python/developer/how-to/index.md +++ b/content/odp/python/developer/how-to/index.md @@ -27,6 +27,16 @@ Guides in this section provide short example code snippets and implementation st diff --git a/content/odp/python/developer/how-to/validators.mdx b/content/odp/python/developer/how-to/validators.mdx index c52f6eb904..07f9301f3a 100644 --- a/content/odp/python/developer/how-to/validators.mdx +++ b/content/odp/python/developer/how-to/validators.mdx @@ -1,6 +1,6 @@ --- title: Validators -sidebar_position: 2 +sidebar_position: 5 description: This guide describes the use of validators with model inputs and outputs. keywords: - ODP diff --git a/content/odp/python/faqs/errors.mdx b/content/odp/python/faqs/errors.mdx index 16c005466d..9519fab5a2 100644 --- a/content/odp/python/faqs/errors.mdx +++ b/content/odp/python/faqs/errors.mdx @@ -26,7 +26,7 @@ There could be a few reasons for this message. 2. The provider extension is installed, but the static assets have not been refreshed. Rebuild the static assets from the command line with: ```sh -python -c "import openbb;openbb.build()" +openbb-build ``` An environment variable to auto-build the static assets on import - if there are changes to the installed configuration - can be defined as: @@ -127,6 +127,19 @@ Be sure to include the contents of the traceback, the operating system and versi +
+ImportError: cannot import name 'OBBject_*' from 'openbb_core.app.provider_interface' + +This error can happen when the static assets were not fully built. The build process may have been interrupted, or a subprocess might be creating a race condition by attempting to import modules before they are ready. + +The solution is to trigger a rebuild from the command line, with the environment active. + +```sh +openbb-build +``` + +
+
How do I start in debug mode? @@ -147,3 +160,14 @@ from openbb import obb ```
+ +
+"Microsoft Visual C++ 14.0 or greater is required" + +Download and install [C++ Build Tools](https://visualstudio.microsoft.com/visual-cpp-build-tools/), restart the machine, then continue. + +![image](https://github.com/OpenBB-finance/OpenBBTerminal/assets/85772166/ceb57be0-6dae-42f2-aca6-bf62ce7d6135) + +![image](https://github.com/OpenBB-finance/OpenBBTerminal/assets/85772166/f8aef8fc-a080-4164-bd36-460714ec44f3) + +
diff --git a/content/odp/python/installation.mdx b/content/odp/python/installation.mdx index 7cfb4249a5..8625accfa5 100644 --- a/content/odp/python/installation.mdx +++ b/content/odp/python/installation.mdx @@ -35,7 +35,7 @@ import HeadTitle from "@site/src/components/General/HeadTitle.tsx"; -Most systems capable of running Python `3.10-3.13` will be compatible. +Most systems capable of running Python `3.10-3.14` will be compatible. ### System Requirements @@ -80,8 +80,6 @@ With the environment created, and activated, begin the installation process. pip install openbb ``` - - ### Docker