Skip to content

Commit ac39b23

Browse files
authored
[V5] openbb-core: Add Backwards-Compatible Layered Config System (openbb.toml) (#7492)
* add backwards-compatible layered config system * fix path reference in windows test * need python version-aware handling in docstring generator
1 parent f18493c commit ac39b23

9 files changed

Lines changed: 1574 additions & 3 deletions

File tree

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
"""Layered configuration discovery for openbb-core.
2+
3+
Mirrors the resolution order ``openbb-cli`` ships with — pyproject →
4+
user-global → project → explicit → .env → real-shell env vars — and
5+
maps the merged result onto the existing ``SystemService`` and
6+
``UserService`` singletons. New code should import from this
7+
subpackage; the legacy ``user_settings.json`` / ``system_settings.json``
8+
disk files keep working unchanged as one layer in the cascade.
9+
"""
10+
11+
from openbb_core.app.config.loader import (
12+
apply_config_to_services,
13+
apply_settings_to_env,
14+
load_config,
15+
load_env_files,
16+
load_layered_config,
17+
render_config_template,
18+
)
19+
20+
__all__ = [
21+
"apply_config_to_services",
22+
"apply_settings_to_env",
23+
"load_config",
24+
"load_env_files",
25+
"load_layered_config",
26+
"render_config_template",
27+
]

0 commit comments

Comments
 (0)