* feat(platform): standardize country inputs using pydantic-extra-types Add CountryParam type that accepts: - ISO 3166-1 alpha-2 codes (e.g., 'US', 'us') - Full country names (e.g., 'United States') - lower_snake_case names (e.g., 'united_states') Uses pydantic-extra-types for programmatic ISO validation instead of hardcoded mappings. Serializes to lowercase alpha-2 code by default. Example usage in FMP equity screener: - country: CountryParam | None Partially addresses #6969 * refactor: use Country class inheriting from str for type checker compatibility - Replace Annotated CountryParam with Country(str) class per maintainer feedback - Store full pycountry object for access to alpha_2, alpha_3, name, numeric - Use pycountry directly instead of pydantic-extra-types - Add support for alpha-3 codes (e.g., 'USA') - Update tests to cover new functionality * Replace pycountry with static JSON country data - Add country_data.json with ISO 3166-1 data (20KB vs 6MB pycountry) - Update Country class to use static JSON lookup - Remove pycountry dependency from pyproject.toml - No decompression needed, data loaded once at import * fix(lint): D402 docstring should start with verb * fix(lint): work around pydocstyle D402 false positive When a method is named `name` and `.pydocstyle.ini` uses `match = .*\.py`, pydocstyle incorrectly triggers D402 for any docstring containing the word "name" anywhere - not just at the start as the rule intends. Changed docstring from "Return the full country name..." to "The country's official designation..." to avoid the false positive. See: https://github.com/PyCQA/pydocstyle/issues/375 * fix(lint): resolve pylint warnings in country_utils * fix(lint): use ternary for ruff SIM108 in country_utils * fix(lint): format ternary for black line length --------- Co-authored-by: Danglewood <85772166+deeleeramone@users.noreply.github.com>
Open Data Platform by OpenBB
Open Data Platform by OpenBB (ODP) is the open-source toolset that helps data engineers integrate proprietary, licensed, and public data sources into downstream applications like AI copilots and research dashboards.
ODP operates as the "connect once, consume everywhere" infrastructure layer that consolidates and exposes data to multiple surfaces at once: Python environments for quants, OpenBB Workspace and Excel for analysts, MCP servers for AI agents, and REST APIs for other applications.
Overview
The Core extension is used as the basis for building and integrating Open Data Platform Python packages. It provides the necessary classes and structures for standardizing and handling data. It is also responsible for generating a REST API and Python package static assets, which operate independently and interface with various consumption vehicles.
Typically, this library will be used as a project dependency, and extended.
Go to the documentation for information on getting started.
Prerequisites
- Python >=3.10,<3.14
- Familiarity with FastAPI and Pydantic.
Installation
Installing through pip:
pip install openbb-core
Note that, the openbb-core is an infrastructural component of the OpenBB Platform. It is not intended to be used as a standalone package.
Build
Build the Python application, with installed extensions, by running:
openbb-build
Key Features
- Standardized Data Model (
DataClass): A flexible and dynamic Pydantic model capable of handling various data structures. - Standardized Query Params (
QueryParamsClass): A Pydantic model for handling querying to different providers. - Dynamic Field Support: Enables handling of undefined fields, providing versatility in data processing.
- Robust Data Validation: Utilizes Pydantic's validation features to ensure data integrity.
- API Routing Mechanism (
RouterClass): Simplifies the process of defining API routes and endpoints - out of the box Python and Web endpoints.
Bugs
Report bugs on Github by opening a new issue, or commenting on an already open one, with all the details.
License
This project is licensed under the AGPL-3.0 License - see the LICENSE.md file for details.