openbb-platform-api 1.2.3__tar.gz → 1.3.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {openbb_platform_api-1.2.3 → openbb_platform_api-1.3.1}/PKG-INFO +5 -4
- {openbb_platform_api-1.2.3 → openbb_platform_api-1.3.1}/openbb_platform_api/assets/default_apps.json +0 -29
- {openbb_platform_api-1.2.3 → openbb_platform_api-1.3.1}/openbb_platform_api/utils/api.py +15 -5
- {openbb_platform_api-1.2.3 → openbb_platform_api-1.3.1}/openbb_platform_api/utils/openapi.py +22 -8
- {openbb_platform_api-1.2.3 → openbb_platform_api-1.3.1}/pyproject.toml +4 -4
- {openbb_platform_api-1.2.3 → openbb_platform_api-1.3.1}/README.md +0 -0
- {openbb_platform_api-1.2.3 → openbb_platform_api-1.3.1}/openbb_platform_api/__init__.py +0 -0
- {openbb_platform_api-1.2.3 → openbb_platform_api-1.3.1}/openbb_platform_api/assets/landing_page.html +0 -0
- {openbb_platform_api-1.2.3 → openbb_platform_api-1.3.1}/openbb_platform_api/main.py +0 -0
- {openbb_platform_api-1.2.3 → openbb_platform_api-1.3.1}/openbb_platform_api/query_models.py +0 -0
- {openbb_platform_api-1.2.3 → openbb_platform_api-1.3.1}/openbb_platform_api/response_models.py +0 -0
- {openbb_platform_api-1.2.3 → openbb_platform_api-1.3.1}/openbb_platform_api/utils/__init__.py +0 -0
- {openbb_platform_api-1.2.3 → openbb_platform_api-1.3.1}/openbb_platform_api/utils/merge_agents.py +0 -0
- {openbb_platform_api-1.2.3 → openbb_platform_api-1.3.1}/openbb_platform_api/utils/merge_apps.py +0 -0
- {openbb_platform_api-1.2.3 → openbb_platform_api-1.3.1}/openbb_platform_api/utils/merge_widgets.py +0 -0
- {openbb_platform_api-1.2.3 → openbb_platform_api-1.3.1}/openbb_platform_api/utils/widgets.py +0 -0
|
@@ -1,20 +1,21 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: openbb-platform-api
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.3.1
|
|
4
4
|
Summary: OpenBB Platform API: Launch script and widgets builder for the Open Data Platform REST API and Workspace Backend Connector.
|
|
5
5
|
License: AGPL-3.0-only
|
|
6
6
|
Author: OpenBB
|
|
7
7
|
Author-email: hello@openbb.co
|
|
8
|
-
Requires-Python: >=3.10,<
|
|
8
|
+
Requires-Python: >=3.10,<4
|
|
9
9
|
Classifier: License :: OSI Approved :: GNU Affero General Public License v3
|
|
10
10
|
Classifier: Programming Language :: Python :: 3
|
|
11
11
|
Classifier: Programming Language :: Python :: 3.10
|
|
12
12
|
Classifier: Programming Language :: Python :: 3.11
|
|
13
13
|
Classifier: Programming Language :: Python :: 3.12
|
|
14
14
|
Classifier: Programming Language :: Python :: 3.13
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
15
16
|
Requires-Dist: deepdiff (>=8.6.1)
|
|
16
|
-
Requires-Dist: openbb-core (>=1.
|
|
17
|
-
Project-URL: Documentation, https://docs.openbb.co/python/extensions/interface/openbb-api
|
|
17
|
+
Requires-Dist: openbb-core (>=1.6.1,<2.0.0)
|
|
18
|
+
Project-URL: Documentation, https://docs.openbb.co/odp/python/extensions/interface/openbb-api
|
|
18
19
|
Project-URL: Homepage, https://openbb.co
|
|
19
20
|
Project-URL: Repository, https://github.com/openbb-finance/openbb
|
|
20
21
|
Description-Content-Type: text/markdown
|
{openbb_platform_api-1.2.3 → openbb_platform_api-1.3.1}/openbb_platform_api/assets/default_apps.json
RENAMED
|
@@ -1,33 +1,4 @@
|
|
|
1
1
|
[
|
|
2
|
-
{
|
|
3
|
-
"name": "FOMC Documents",
|
|
4
|
-
"img": "https://upload.wikimedia.org/wikipedia/commons/thumb/7/71/Flag_of_the_United_States_Federal_Reserve.svg/640px-Flag_of_the_United_States_Federal_Reserve.svg.png",
|
|
5
|
-
"img_dark": "",
|
|
6
|
-
"img_light": "",
|
|
7
|
-
"description": "Read current and historical FOMC documents, beginning 1959.",
|
|
8
|
-
"allowCustomization": true,
|
|
9
|
-
"tabs": {
|
|
10
|
-
"overview": {
|
|
11
|
-
"id": "overview",
|
|
12
|
-
"name": "overview",
|
|
13
|
-
"layout": [
|
|
14
|
-
{
|
|
15
|
-
"i": "economy_fomc_documents_federal_reserve_obb",
|
|
16
|
-
"x": 0,
|
|
17
|
-
"y": 0,
|
|
18
|
-
"w": 40,
|
|
19
|
-
"h": 42,
|
|
20
|
-
"state": {
|
|
21
|
-
"params": {
|
|
22
|
-
"year": 2025
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
]
|
|
27
|
-
}
|
|
28
|
-
},
|
|
29
|
-
"groups": []
|
|
30
|
-
},
|
|
31
2
|
{
|
|
32
3
|
"name": "Example FRED App",
|
|
33
4
|
"img": "https://tvblog-static.tradingview.com/uploads/2021/07/fred-preview.png",
|
|
@@ -218,6 +218,17 @@ def import_app(app_path: str, name: str = "app", factory: bool = False):
|
|
|
218
218
|
from openbb_core.api.app_loader import AppLoader
|
|
219
219
|
from openbb_core.api.rest_api import system
|
|
220
220
|
|
|
221
|
+
def _is_module_colon_notation(app_path: str) -> bool:
|
|
222
|
+
"""Check if the path uses module:name notation vs a Windows path."""
|
|
223
|
+
if ":" not in app_path:
|
|
224
|
+
return False
|
|
225
|
+
# Windows absolute path check (e.g., C:\path or D:/path)
|
|
226
|
+
if len(app_path) >= 2 and app_path[1] == ":" and app_path[0].isalpha():
|
|
227
|
+
# Could still have colon notation: C:\path\file.py:app
|
|
228
|
+
parts = app_path.split(":")
|
|
229
|
+
return len(parts) > 2 # More than just drive letter colon
|
|
230
|
+
return True
|
|
231
|
+
|
|
221
232
|
def _load_module_from_file_path(file_path: str):
|
|
222
233
|
spec_name = os.path.basename(file_path).split(".")[0]
|
|
223
234
|
spec = util.spec_from_file_location(spec_name, file_path)
|
|
@@ -230,16 +241,15 @@ def import_app(app_path: str, name: str = "app", factory: bool = False):
|
|
|
230
241
|
spec.loader.exec_module(module) # type: ignore
|
|
231
242
|
return module
|
|
232
243
|
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
module_path, name = app_path.split(":")
|
|
244
|
+
if _is_module_colon_notation(app_path):
|
|
245
|
+
module_path, name = app_path.rsplit(":", 1)
|
|
236
246
|
try: # First try to import as a module
|
|
237
247
|
module = import_module(module_path)
|
|
238
248
|
except ImportError: # If module import fails, try to load as a local file
|
|
239
249
|
if not module_path.endswith(".py"):
|
|
240
250
|
module_path += ".py"
|
|
241
251
|
|
|
242
|
-
if not
|
|
252
|
+
if not Path(module_path).is_absolute():
|
|
243
253
|
cwd = Path.cwd()
|
|
244
254
|
file_path = str(cwd.joinpath(module_path).resolve())
|
|
245
255
|
else:
|
|
@@ -254,7 +264,7 @@ def import_app(app_path: str, name: str = "app", factory: bool = False):
|
|
|
254
264
|
|
|
255
265
|
# Case 2: File path (e.g., "main.py" or "my_app/main.py")
|
|
256
266
|
else:
|
|
257
|
-
if not
|
|
267
|
+
if not Path(app_path).is_absolute():
|
|
258
268
|
cwd = Path.cwd()
|
|
259
269
|
app_path = str(cwd.joinpath(app_path).resolve())
|
|
260
270
|
|
{openbb_platform_api-1.2.3 → openbb_platform_api-1.3.1}/openbb_platform_api/utils/openapi.py
RENAMED
|
@@ -662,7 +662,8 @@ def get_data_schema_for_widget(openapi_json, operation_id, route: str | None = N
|
|
|
662
662
|
return None
|
|
663
663
|
|
|
664
664
|
|
|
665
|
-
|
|
665
|
+
# pylint: disable=too-many-branches,too-many-statements
|
|
666
|
+
def data_schema_to_columns_defs( # noqa: PLR0912
|
|
666
667
|
openapi_json,
|
|
667
668
|
operation_id,
|
|
668
669
|
provider,
|
|
@@ -718,16 +719,29 @@ def data_schema_to_columns_defs( # noqa: PLR0912 # pylint: disable=too-many-br
|
|
|
718
719
|
target_schema = schemas[0]
|
|
719
720
|
else:
|
|
720
721
|
for schema in schemas:
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
722
|
+
schema_desc = schema.get("description", "").lower()
|
|
723
|
+
provider_lower = provider.lower().replace("tradingeconomics", "te")
|
|
724
|
+
# Check if description starts with provider name (with or without underscores/spaces)
|
|
725
|
+
provider_variants = [
|
|
726
|
+
provider_lower,
|
|
727
|
+
provider_lower.replace("_", " "),
|
|
728
|
+
provider_lower.replace("_", ""),
|
|
729
|
+
]
|
|
730
|
+
if any(schema_desc.startswith(v) for v in provider_variants) or (
|
|
731
|
+
schema_desc.startswith("us government")
|
|
728
732
|
):
|
|
729
733
|
target_schema = schema
|
|
730
734
|
break
|
|
735
|
+
# Fallback: if no description match, try matching by schema title/name
|
|
736
|
+
if not target_schema:
|
|
737
|
+
for schema in schemas:
|
|
738
|
+
schema_title = schema.get("title", "").lower()
|
|
739
|
+
if provider.lower().replace("_", "") in schema_title.replace("_", ""):
|
|
740
|
+
target_schema = schema
|
|
741
|
+
break
|
|
742
|
+
# Final fallback: use the first schema if still no match
|
|
743
|
+
if not target_schema and schemas:
|
|
744
|
+
target_schema = schemas[0]
|
|
731
745
|
|
|
732
746
|
if get_widget_config:
|
|
733
747
|
return target_schema.get("x-widget_config", {})
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
[tool.poetry]
|
|
2
2
|
name = "openbb-platform-api"
|
|
3
|
-
version = "1.
|
|
3
|
+
version = "1.3.1"
|
|
4
4
|
description = "OpenBB Platform API: Launch script and widgets builder for the Open Data Platform REST API and Workspace Backend Connector."
|
|
5
5
|
authors = ["OpenBB <hello@openbb.co>"]
|
|
6
6
|
license = "AGPL-3.0-only"
|
|
7
7
|
readme = "README.md"
|
|
8
8
|
homepage = "https://openbb.co"
|
|
9
9
|
repository = "https://github.com/openbb-finance/openbb"
|
|
10
|
-
documentation = "https://docs.openbb.co/python/extensions/interface/openbb-api"
|
|
10
|
+
documentation = "https://docs.openbb.co/odp/python/extensions/interface/openbb-api"
|
|
11
11
|
packages = [{ include = "openbb_platform_api" }]
|
|
12
12
|
|
|
13
13
|
[tool.poetry.scripts]
|
|
14
14
|
openbb-api = "openbb_platform_api.main:main"
|
|
15
15
|
|
|
16
16
|
[tool.poetry.dependencies]
|
|
17
|
-
python = ">=3.10,<
|
|
18
|
-
openbb-core = "^1.
|
|
17
|
+
python = ">=3.10,<4"
|
|
18
|
+
openbb-core = "^1.6.1"
|
|
19
19
|
deepdiff = ">=8.6.1"
|
|
20
20
|
|
|
21
21
|
[build-system]
|
|
File without changes
|
|
File without changes
|
{openbb_platform_api-1.2.3 → openbb_platform_api-1.3.1}/openbb_platform_api/assets/landing_page.html
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{openbb_platform_api-1.2.3 → openbb_platform_api-1.3.1}/openbb_platform_api/response_models.py
RENAMED
|
File without changes
|
{openbb_platform_api-1.2.3 → openbb_platform_api-1.3.1}/openbb_platform_api/utils/__init__.py
RENAMED
|
File without changes
|
{openbb_platform_api-1.2.3 → openbb_platform_api-1.3.1}/openbb_platform_api/utils/merge_agents.py
RENAMED
|
File without changes
|
{openbb_platform_api-1.2.3 → openbb_platform_api-1.3.1}/openbb_platform_api/utils/merge_apps.py
RENAMED
|
File without changes
|
{openbb_platform_api-1.2.3 → openbb_platform_api-1.3.1}/openbb_platform_api/utils/merge_widgets.py
RENAMED
|
File without changes
|
{openbb_platform_api-1.2.3 → openbb_platform_api-1.3.1}/openbb_platform_api/utils/widgets.py
RENAMED
|
File without changes
|