Skip to content

Commit aa92e9c

Browse files
committed
some updates for next release
1 parent 9b9842c commit aa92e9c

13 files changed

Lines changed: 223 additions & 12 deletions

content/odp/cli/installation.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import HeadTitle from '@site/src/components/General/HeadTitle.tsx';
2222

2323
ODP CLI is a wrapper around the [OpenBB Python Package](/odp/python), and should be installed along side an existing OpenBB installation.
2424

25-
- A Python virtual environment with a version between 3.9 and 3.11, inclusive, is required.
25+
- A Python virtual environment with a version between 3.10 and 3.14, inclusive, is required.
2626

2727
Please refer to the [Python install documentation](/odp/python/installation) for instructions and more information.
2828

content/odp/python/developer/how-to/annotated_results.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: Annotated Results
3-
sidebar_position: 6
3+
sidebar_position: 4
44
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.
55
keywords:
66
- ODP
Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
---
2+
title: Country Input Component
3+
sidebar_position: 1
4+
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.
5+
keywords:
6+
- country
7+
- countries
8+
- ISO 3166
9+
- input
10+
- develop
11+
- odp
12+
- python
13+
---
14+
15+
import HeadTitle from '@site/src/components/General/HeadTitle.tsx';
16+
17+
<HeadTitle title="Country Input Component - Developer | OpenBB Docs" />
18+
19+
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.
20+
21+
## Import
22+
23+
```python
24+
from openbb_core.provider.utils.country_utils import Country
25+
```
26+
27+
## Usage
28+
29+
The `__repr__` of class instance will be the 2-letter country code.
30+
31+
```python
32+
>>> Country("United States")
33+
'US'
34+
>>> Country("gb").name
35+
'United Kingdom'
36+
>>> Country("hk").alpha_3
37+
'HKG'
38+
>>> Country("United States") == 'US'
39+
True
40+
>>> c = Country("united_states")
41+
>>> isinstance(c, str)
42+
True
43+
>>> c.alpha_2
44+
'US'
45+
>>> c.alpha_3
46+
'USA'
47+
>>> c.name
48+
'United States'
49+
>>> c.groups
50+
['G7', 'G20', 'NATO', 'OECD']
51+
>>> c.is_member_of("G7")
52+
True
53+
```
54+
55+
### Properties
56+
57+
- **alpha_2** : str - ISO 3166-1 alpha-2 code.
58+
- **alpha_3** : str - ISO 3166-1 alpha-3 code.
59+
- **name** : str - The country's display name, in English.
60+
- **numeric**: str - ISO 3166-1 numeric code.
61+
- **groups**: list[str] - List of membership groups the country belongs to.
62+
63+
### Methods
64+
65+
- **is_member_of(self, group: str) -> bool**: Check if a country is a member of a specific group.
66+
67+
## Updating Definitions
68+
69+
If the definitions have become stale, you can refresh them in the environment with the update script.
70+
71+
```sh
72+
pip install pycountry
73+
python -m openbb_core.provider.utils.update_country_data
74+
```
75+
76+
## Sources
77+
78+
- ISO 3166-1: https://en.wikipedia.org/wiki/ISO_3166-1
79+
- pycountry: https://github.com/pycountry/pycountry
80+
- G7: https://en.wikipedia.org/wiki/G7
81+
- G20: https://en.wikipedia.org/wiki/G20
82+
- EU: https://european-union.europa.eu/principles-countries-history/eu-countries_en
83+
- NATO: https://www.nato.int/en/about-us/organization/nato-member-countries
84+
- OECD: https://en.wikipedia.org/wiki/OECD
85+
- OPEC: https://en.wikipedia.org/wiki/OPEC
86+
- BRICS: https://en.wikipedia.org/wiki/BRICS

content/odp/python/developer/how-to/deprecating_endpoints.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: Deprecating Endpoints
3-
sidebar_position: 6
3+
sidebar_position: 7
44
description: This guide provides detailed instructions on how to deprecate an endpoint in the ODP Python Package.
55
keywords:
66
- ODP

content/odp/python/developer/how-to/disabling_output_validation.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: Disabling Output Validation
3-
sidebar_position: 3
3+
sidebar_position: 6
44
description: This page provides instructions for disabling output validation, when defining a new router function.
55
keywords:
66
- Validation

content/odp/python/developer/how-to/dynamic_command_execution.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: Dynamic Command Execution
3-
sidebar_position: 2
3+
sidebar_position: 7
44
description: This guide provides detailed instructions on how to execute commands dynamically in the OpenBB Python Package.
55
keywords:
66
- ODP

content/odp/python/developer/how-to/examples.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: Function Examples
3-
sidebar_position: 2
3+
sidebar_position: 4
44
description: This page explains how to add examples and code snippets to API and Python endpoints.
55
keywords:
66
- ODP
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
---
2+
title: Exchange Input Component
3+
sidebar_position: 2
4+
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.
5+
keywords:
6+
- exchange
7+
- MIC
8+
- market
9+
- ISO 10383
10+
- input
11+
- develop
12+
- odp
13+
- python
14+
---
15+
16+
import HeadTitle from '@site/src/components/General/HeadTitle.tsx';
17+
18+
<HeadTitle title="Exchange Input Component - Developer | OpenBB Docs" />
19+
20+
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.
21+
22+
Use this class for functions with an 'exchange' parameter, or to convert between MICs, exchange acronyms or names.
23+
24+
## Import
25+
26+
```python
27+
from openbb_core.provider.utils.exchange_utils import Exchange
28+
```
29+
30+
## Usage
31+
32+
Initialize the class with any of the accepted inputs:
33+
34+
- ISO 10383 MIC codes (e.g., "XNAS", "XNYS")
35+
- Exchange acronyms (e.g., "NASDAQ", "NYSE")
36+
- Full exchange names (e.g., "New York Stock Exchange")
37+
- lower_snake_case names (e.g., "new_york_stock_exchange")
38+
39+
```python
40+
>>> e = Exchange("nasdaq")
41+
>>> str(e)
42+
'XNAS'
43+
>>> e.mic
44+
'XNAS'
45+
>>> e.acronym
46+
'NASDAQ'
47+
>>> e.name
48+
'NASDAQ - ALL MARKETS'
49+
```
50+
51+
### Properties
52+
53+
- **mic** : str - ISO 10383 Market Identifier Code.
54+
- **acronym** : str - Exchange acronym/short name.
55+
- **name** : str - Full exchange name.
56+
57+
58+
## Updating Definitions
59+
60+
If the definitions have become stale, you can refresh them in the environment with the update script.
61+
62+
```sh
63+
python -m openbb_core.provider.utils.update_exchange_data
64+
```
65+
66+
## Source
67+
68+
- https://www.iso20022.org/market-identifier-codes

content/odp/python/developer/how-to/http_requests.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: HTTP Requests
3-
sidebar_position: 1
3+
sidebar_position: 3
44
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.
55
keywords:
66
- OpenBB Platform

content/odp/python/developer/how-to/index.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,16 @@ Guides in this section provide short example code snippets and implementation st
2727

2828

2929
<ul className="grid grid-cols-1 gap-2 -ml-6">
30+
<NewReferenceCard
31+
title="Country Input Component"
32+
description="How to utilize the built-in reusable country component for input standardization and format conversion."
33+
url="/odp/python/developer/how-to/country_input"
34+
/>
35+
<NewReferenceCard
36+
title="Exchange Input Component"
37+
description="How to utilize the built-in reusable exchange component for input standardization and format conversion."
38+
url="/odp/python/developer/how-to/exchange_input"
39+
/>
3040
<NewReferenceCard
3141
title="HTTP Requests"
3242
description="How to utilize the built-in and configured session objects for external HTTP requests."
@@ -37,4 +47,29 @@ Guides in this section provide short example code snippets and implementation st
3747
description="How to include additional metadata from a provider in the function output."
3848
url="/odp/python/developer/how-to/annotated_results"
3949
/>
50+
<NewReferenceCard
51+
title="Function Examples"
52+
description="How to include function examples in the code."
53+
url="/odp/python/developer/how-to/examples"
54+
/>
55+
<NewReferenceCard
56+
title="Validators"
57+
description="How to validate models and fields with Pydantic validators."
58+
url="/odp/python/developer/how-to/validators"
59+
/>
60+
<NewReferenceCard
61+
title="Disabling Output Validation"
62+
description="How to disable output validation on a specific endpoint."
63+
url="/odp/python/developer/how-to/disabling_output_validation"
64+
/>
65+
<NewReferenceCard
66+
title="Deprecating Endpoints"
67+
description="How to mark an endpoint as deprecated."
68+
url="/odp/python/developer/how-to/deprecating_endpoints"
69+
/>
70+
<NewReferenceCard
71+
title="Dynamic Command Execution"
72+
description="How to use CommandRunner for dynamic command execution."
73+
url="/odp/python/developer/how-to/dynamic_command_execution"
74+
/>
4075
</ul>

0 commit comments

Comments
 (0)