openbb-cli 1.1.0__tar.gz → 1.1.2__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_cli-1.1.0 → openbb_cli-1.1.2}/PKG-INFO +5 -4
- {openbb_cli-1.1.0 → openbb_cli-1.1.2}/README.md +2 -2
- {openbb_cli-1.1.0 → openbb_cli-1.1.2}/openbb_cli/argparse_translator/argparse_translator.py +7 -5
- {openbb_cli-1.1.0 → openbb_cli-1.1.2}/openbb_cli/controllers/base_platform_controller.py +2 -0
- {openbb_cli-1.1.0 → openbb_cli-1.1.2}/openbb_cli/controllers/utils.py +7 -25
- {openbb_cli-1.1.0 → openbb_cli-1.1.2}/openbb_cli/session.py +19 -0
- {openbb_cli-1.1.0 → openbb_cli-1.1.2}/pyproject.toml +4 -3
- {openbb_cli-1.1.0 → openbb_cli-1.1.2}/openbb_cli/__init__.py +0 -0
- {openbb_cli-1.1.0 → openbb_cli-1.1.2}/openbb_cli/argparse_translator/__init__.py +0 -0
- {openbb_cli-1.1.0 → openbb_cli-1.1.2}/openbb_cli/argparse_translator/argparse_argument.py +0 -0
- {openbb_cli-1.1.0 → openbb_cli-1.1.2}/openbb_cli/argparse_translator/argparse_class_processor.py +0 -0
- {openbb_cli-1.1.0 → openbb_cli-1.1.2}/openbb_cli/argparse_translator/obbject_registry.py +0 -0
- {openbb_cli-1.1.0 → openbb_cli-1.1.2}/openbb_cli/argparse_translator/reference_processor.py +0 -0
- {openbb_cli-1.1.0 → openbb_cli-1.1.2}/openbb_cli/argparse_translator/utils.py +0 -0
- {openbb_cli-1.1.0 → openbb_cli-1.1.2}/openbb_cli/assets/routines/routine_example.openbb +0 -0
- {openbb_cli-1.1.0 → openbb_cli-1.1.2}/openbb_cli/assets/styles/default/Consolas.ttf +0 -0
- {openbb_cli-1.1.0 → openbb_cli-1.1.2}/openbb_cli/assets/styles/default/dark.mpfstyle.json +0 -0
- {openbb_cli-1.1.0 → openbb_cli-1.1.2}/openbb_cli/assets/styles/default/dark.mplrc.json +0 -0
- {openbb_cli-1.1.0 → openbb_cli-1.1.2}/openbb_cli/assets/styles/default/dark.mplstyle +0 -0
- {openbb_cli-1.1.0 → openbb_cli-1.1.2}/openbb_cli/assets/styles/default/dark.pltstyle.json +0 -0
- {openbb_cli-1.1.0 → openbb_cli-1.1.2}/openbb_cli/assets/styles/default/dark.richstyle.json +0 -0
- {openbb_cli-1.1.0 → openbb_cli-1.1.2}/openbb_cli/assets/styles/default/light.mpfstyle.json +0 -0
- {openbb_cli-1.1.0 → openbb_cli-1.1.2}/openbb_cli/assets/styles/default/light.mplrc.json +0 -0
- {openbb_cli-1.1.0 → openbb_cli-1.1.2}/openbb_cli/assets/styles/default/light.mplstyle +0 -0
- {openbb_cli-1.1.0 → openbb_cli-1.1.2}/openbb_cli/assets/styles/default/light.pltstyle.json +0 -0
- {openbb_cli-1.1.0 → openbb_cli-1.1.2}/openbb_cli/assets/styles/default/light.richstyle.json +0 -0
- {openbb_cli-1.1.0 → openbb_cli-1.1.2}/openbb_cli/assets/styles/default/tables.pltstyle.json +0 -0
- {openbb_cli-1.1.0 → openbb_cli-1.1.2}/openbb_cli/assets/styles/user/openbb.richstyle.json +0 -0
- {openbb_cli-1.1.0 → openbb_cli-1.1.2}/openbb_cli/cli.py +0 -0
- {openbb_cli-1.1.0 → openbb_cli-1.1.2}/openbb_cli/config/__init__.py +0 -0
- {openbb_cli-1.1.0 → openbb_cli-1.1.2}/openbb_cli/config/completer.py +0 -0
- {openbb_cli-1.1.0 → openbb_cli-1.1.2}/openbb_cli/config/console.py +0 -0
- {openbb_cli-1.1.0 → openbb_cli-1.1.2}/openbb_cli/config/constants.py +0 -0
- {openbb_cli-1.1.0 → openbb_cli-1.1.2}/openbb_cli/config/menu_text.py +0 -0
- {openbb_cli-1.1.0 → openbb_cli-1.1.2}/openbb_cli/config/setup.py +0 -0
- {openbb_cli-1.1.0 → openbb_cli-1.1.2}/openbb_cli/config/style.py +0 -0
- {openbb_cli-1.1.0 → openbb_cli-1.1.2}/openbb_cli/controllers/base_controller.py +0 -0
- {openbb_cli-1.1.0 → openbb_cli-1.1.2}/openbb_cli/controllers/choices.py +0 -0
- {openbb_cli-1.1.0 → openbb_cli-1.1.2}/openbb_cli/controllers/cli_controller.py +0 -0
- {openbb_cli-1.1.0 → openbb_cli-1.1.2}/openbb_cli/controllers/hub_service.py +0 -0
- {openbb_cli-1.1.0 → openbb_cli-1.1.2}/openbb_cli/controllers/platform_controller_factory.py +0 -0
- {openbb_cli-1.1.0 → openbb_cli-1.1.2}/openbb_cli/controllers/script_parser.py +0 -0
- {openbb_cli-1.1.0 → openbb_cli-1.1.2}/openbb_cli/controllers/settings_controller.py +0 -0
- {openbb_cli-1.1.0 → openbb_cli-1.1.2}/openbb_cli/models/settings.py +0 -0
- {openbb_cli-1.1.0 → openbb_cli-1.1.2}/openbb_cli/utils/utils.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: openbb-cli
|
|
3
|
-
Version: 1.1.
|
|
3
|
+
Version: 1.1.2
|
|
4
4
|
Summary: Investment Research for Everyone, Anywhere.
|
|
5
5
|
Home-page: https://openbb.co
|
|
6
6
|
License: AGPL-3.0-only
|
|
@@ -13,10 +13,11 @@ Classifier: Programming Language :: Python :: 3.9
|
|
|
13
13
|
Classifier: Programming Language :: Python :: 3.10
|
|
14
14
|
Classifier: Programming Language :: Python :: 3.11
|
|
15
15
|
Classifier: Programming Language :: Python :: 3.12
|
|
16
|
-
Requires-Dist: openbb[all] (>=4.3.
|
|
16
|
+
Requires-Dist: openbb[all] (>=4.3.2,<5.0.0)
|
|
17
17
|
Requires-Dist: openpyxl (>=3.1.2,<4.0.0)
|
|
18
18
|
Requires-Dist: prompt-toolkit (>=3.0.16,<4.0.0)
|
|
19
19
|
Requires-Dist: python-dotenv (>=1.0.0,<2.0.0)
|
|
20
|
+
Requires-Dist: pywry (>=0.6.2,<0.7.0)
|
|
20
21
|
Requires-Dist: rich (>=13,<14)
|
|
21
22
|
Project-URL: Documentation, https://docs.openbb.co/cli
|
|
22
23
|
Project-URL: Repository, https://github.com/OpenBB-finance/OpenBB
|
|
@@ -36,13 +37,13 @@ Description-Content-Type: text/markdown
|
|
|
36
37
|
|
|
37
38
|
The OpenBB Platform CLI is a command line interface that wraps [OpenBB Platform](https://docs.openbb.co/platform).
|
|
38
39
|
|
|
39
|
-
It offers a convenient way to interact with the OpenBB Platform and its extensions, as well as
|
|
40
|
+
It offers a convenient way to interact with the OpenBB Platform and its extensions, as well as automated data collection via OpenBB Routine Scripts.
|
|
40
41
|
|
|
41
42
|
Find the most complete documentation, examples, and usage guides for the OpenBB Platform CLI [here](https://docs.openbb.co/cli).
|
|
42
43
|
|
|
43
44
|
## Installation
|
|
44
45
|
|
|
45
|
-
The command below provides access to
|
|
46
|
+
The command below provides access to all the available OpenBB extensions behind the OpenBB Platform, find the complete list [here](https://my.openbb.co/app/platform/extensions).
|
|
46
47
|
|
|
47
48
|
```bash
|
|
48
49
|
pip install openbb-cli
|
|
@@ -12,13 +12,13 @@
|
|
|
12
12
|
|
|
13
13
|
The OpenBB Platform CLI is a command line interface that wraps [OpenBB Platform](https://docs.openbb.co/platform).
|
|
14
14
|
|
|
15
|
-
It offers a convenient way to interact with the OpenBB Platform and its extensions, as well as
|
|
15
|
+
It offers a convenient way to interact with the OpenBB Platform and its extensions, as well as automated data collection via OpenBB Routine Scripts.
|
|
16
16
|
|
|
17
17
|
Find the most complete documentation, examples, and usage guides for the OpenBB Platform CLI [here](https://docs.openbb.co/cli).
|
|
18
18
|
|
|
19
19
|
## Installation
|
|
20
20
|
|
|
21
|
-
The command below provides access to
|
|
21
|
+
The command below provides access to all the available OpenBB extensions behind the OpenBB Platform, find the complete list [here](https://my.openbb.co/app/platform/extensions).
|
|
22
22
|
|
|
23
23
|
```bash
|
|
24
24
|
pip install openbb-cli
|
|
@@ -400,22 +400,23 @@ class ArgparseTranslator:
|
|
|
400
400
|
"""
|
|
401
401
|
kwargs = self._unflatten_args(vars(parsed_args))
|
|
402
402
|
kwargs = self._update_with_custom_types(kwargs)
|
|
403
|
-
|
|
404
403
|
provider = kwargs.get("provider")
|
|
405
|
-
provider_args = []
|
|
404
|
+
provider_args: List = []
|
|
406
405
|
if provider and provider in self.provider_parameters:
|
|
407
406
|
provider_args = self.provider_parameters[provider]
|
|
408
407
|
else:
|
|
409
408
|
for args in self.provider_parameters.values():
|
|
410
409
|
provider_args.extend(args)
|
|
411
410
|
|
|
412
|
-
# remove kwargs
|
|
411
|
+
# remove kwargs not matching the signature, provider parameters, or are empty.
|
|
413
412
|
kwargs = {
|
|
414
413
|
key: value
|
|
415
414
|
for key, value in kwargs.items()
|
|
416
|
-
if
|
|
415
|
+
if (
|
|
416
|
+
(key in self.signature.parameters or key in provider_args)
|
|
417
|
+
and (value or value is False)
|
|
418
|
+
)
|
|
417
419
|
}
|
|
418
|
-
|
|
419
420
|
return self.func(**kwargs)
|
|
420
421
|
|
|
421
422
|
def parse_args_and_execute(self) -> Any:
|
|
@@ -426,6 +427,7 @@ class ArgparseTranslator:
|
|
|
426
427
|
Any: The return value of the original function.
|
|
427
428
|
"""
|
|
428
429
|
parsed_args = self._parser.parse_args()
|
|
430
|
+
|
|
429
431
|
return self.execute_func(parsed_args)
|
|
430
432
|
|
|
431
433
|
def translate(self) -> Callable:
|
|
@@ -232,6 +232,8 @@ class PlatformController(BaseController):
|
|
|
232
232
|
fig = obbject.chart.fig if obbject.chart else None
|
|
233
233
|
if not export:
|
|
234
234
|
obbject.show()
|
|
235
|
+
elif session.settings.USE_INTERACTIVE_DF and not export:
|
|
236
|
+
obbject.charting.table()
|
|
235
237
|
else:
|
|
236
238
|
if isinstance(df.columns, pd.RangeIndex):
|
|
237
239
|
df.columns = [str(i) for i in df.columns]
|
|
@@ -16,11 +16,8 @@ from typing import TYPE_CHECKING, Dict, List, Optional, Tuple, Union
|
|
|
16
16
|
import numpy as np
|
|
17
17
|
import pandas as pd
|
|
18
18
|
import requests
|
|
19
|
-
from openbb import obb
|
|
20
|
-
from openbb_charting.core.backend import create_backend, get_backend
|
|
21
19
|
from openbb_cli.config.constants import AVAILABLE_FLAIRS, ENV_FILE_SETTINGS
|
|
22
20
|
from openbb_cli.session import Session
|
|
23
|
-
from openbb_core.app.model.charts.charting_settings import ChartingSettings
|
|
24
21
|
from openbb_core.app.model.obbject import OBBject
|
|
25
22
|
from pytz import all_timezones, timezone
|
|
26
23
|
from rich.table import Table
|
|
@@ -303,20 +300,6 @@ def return_colored_value(value: str):
|
|
|
303
300
|
return f"{value}"
|
|
304
301
|
|
|
305
302
|
|
|
306
|
-
def _get_backend():
|
|
307
|
-
"""Get the Platform charting backend."""
|
|
308
|
-
try:
|
|
309
|
-
return get_backend()
|
|
310
|
-
except ValueError:
|
|
311
|
-
# backend might not be created yet
|
|
312
|
-
charting_settings = ChartingSettings(
|
|
313
|
-
system_settings=obb.system, user_settings=obb.user # type: ignore
|
|
314
|
-
)
|
|
315
|
-
create_backend(charting_settings)
|
|
316
|
-
get_backend().start(debug=charting_settings.debug_mode)
|
|
317
|
-
return get_backend()
|
|
318
|
-
|
|
319
|
-
|
|
320
303
|
# pylint: disable=too-many-arguments
|
|
321
304
|
def print_rich_table( # noqa: PLR0912
|
|
322
305
|
df: pd.DataFrame,
|
|
@@ -385,7 +368,7 @@ def print_rich_table( # noqa: PLR0912
|
|
|
385
368
|
isinstance(df[col].iloc[x], pd.Timestamp)
|
|
386
369
|
for x in range(min(10, len(df)))
|
|
387
370
|
):
|
|
388
|
-
df[col] =
|
|
371
|
+
df[col] = df[col].apply(pd.to_numeric)
|
|
389
372
|
except (ValueError, TypeError):
|
|
390
373
|
df[col] = df[col].astype(str)
|
|
391
374
|
|
|
@@ -396,7 +379,7 @@ def print_rich_table( # noqa: PLR0912
|
|
|
396
379
|
output = list(_headers)
|
|
397
380
|
if len(output) != len(df.columns):
|
|
398
381
|
raise ValueError("Length of headers does not match length of DataFrame.")
|
|
399
|
-
return output
|
|
382
|
+
return output # type: ignore
|
|
400
383
|
|
|
401
384
|
if session.settings.USE_INTERACTIVE_DF:
|
|
402
385
|
df_outgoing = df.copy()
|
|
@@ -414,10 +397,7 @@ def print_rich_table( # noqa: PLR0912
|
|
|
414
397
|
if col == "":
|
|
415
398
|
df_outgoing = df_outgoing.rename(columns={col: " "})
|
|
416
399
|
|
|
417
|
-
#
|
|
418
|
-
df_outgoing = df_outgoing.applymap(str)
|
|
419
|
-
|
|
420
|
-
_get_backend().send_table(
|
|
400
|
+
session._backend.send_table( # type: ignore # pylint: disable=protected-access
|
|
421
401
|
df_table=df_outgoing,
|
|
422
402
|
title=title,
|
|
423
403
|
theme=session.user.preferences.table_style,
|
|
@@ -1014,12 +994,14 @@ def handle_obbject_display(
|
|
|
1014
994
|
if obbject.chart:
|
|
1015
995
|
obbject.show(**kwargs)
|
|
1016
996
|
else:
|
|
1017
|
-
obbject.charting.to_chart(**kwargs)
|
|
997
|
+
obbject.charting.to_chart(**kwargs) # type: ignore
|
|
1018
998
|
if export:
|
|
1019
|
-
fig = obbject.chart.fig
|
|
999
|
+
fig = obbject.chart.fig # type: ignore
|
|
1020
1000
|
df = obbject.to_dataframe()
|
|
1021
1001
|
except Exception as e:
|
|
1022
1002
|
session.console.print(f"Failed to display chart: {e}")
|
|
1003
|
+
elif session.settings.USE_INTERACTIVE_DF:
|
|
1004
|
+
obbject.charting.table() # type: ignore
|
|
1023
1005
|
else:
|
|
1024
1006
|
df = obbject.to_dataframe()
|
|
1025
1007
|
print_rich_table(
|
|
@@ -5,7 +5,9 @@ from pathlib import Path
|
|
|
5
5
|
from typing import Optional
|
|
6
6
|
|
|
7
7
|
from openbb import obb
|
|
8
|
+
from openbb_charting.core.backend import create_backend, get_backend
|
|
8
9
|
from openbb_core.app.model.abstract.singleton import SingletonMeta
|
|
10
|
+
from openbb_core.app.model.charts.charting_settings import ChartingSettings
|
|
9
11
|
from openbb_core.app.model.user_settings import UserSettings as User
|
|
10
12
|
from prompt_toolkit import PromptSession
|
|
11
13
|
|
|
@@ -17,11 +19,26 @@ from openbb_cli.config.style import Style
|
|
|
17
19
|
from openbb_cli.models.settings import Settings
|
|
18
20
|
|
|
19
21
|
|
|
22
|
+
def _get_backend():
|
|
23
|
+
"""Get the Platform charting backend."""
|
|
24
|
+
try:
|
|
25
|
+
return get_backend()
|
|
26
|
+
except ValueError:
|
|
27
|
+
# backend might not be created yet
|
|
28
|
+
charting_settings = ChartingSettings(
|
|
29
|
+
system_settings=obb.system, user_settings=obb.user # type: ignore
|
|
30
|
+
)
|
|
31
|
+
create_backend(charting_settings)
|
|
32
|
+
get_backend().start(debug=charting_settings.debug_mode) # type: ignore
|
|
33
|
+
return get_backend()
|
|
34
|
+
|
|
35
|
+
|
|
20
36
|
class Session(metaclass=SingletonMeta):
|
|
21
37
|
"""Session class."""
|
|
22
38
|
|
|
23
39
|
def __init__(self):
|
|
24
40
|
"""Initialize session."""
|
|
41
|
+
|
|
25
42
|
self._obb = obb
|
|
26
43
|
self._settings = Settings()
|
|
27
44
|
self._style = Style(
|
|
@@ -34,6 +51,8 @@ class Session(metaclass=SingletonMeta):
|
|
|
34
51
|
self._prompt_session = self._get_prompt_session()
|
|
35
52
|
self._obbject_registry = Registry()
|
|
36
53
|
|
|
54
|
+
self._backend = _get_backend()
|
|
55
|
+
|
|
37
56
|
@property
|
|
38
57
|
def user(self) -> User:
|
|
39
58
|
"""Get platform user."""
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[tool.poetry]
|
|
2
2
|
name = "openbb-cli"
|
|
3
|
-
version = "1.1.
|
|
3
|
+
version = "1.1.2"
|
|
4
4
|
description = "Investment Research for Everyone, Anywhere."
|
|
5
5
|
authors = ["OpenBB <hello@openbb.co>"]
|
|
6
6
|
packages = [{ include = "openbb_cli" }]
|
|
@@ -17,14 +17,15 @@ openbb = 'openbb_cli.cli:main'
|
|
|
17
17
|
python = "^3.9,<3.13"
|
|
18
18
|
|
|
19
19
|
# OpenBB dependencies
|
|
20
|
-
openbb = { version = "^4.3.
|
|
20
|
+
openbb = { version = "^4.3.2", extras = ["all"] }
|
|
21
21
|
|
|
22
22
|
# CLI dependencies
|
|
23
23
|
prompt-toolkit = "^3.0.16"
|
|
24
24
|
rich = "^13"
|
|
25
25
|
python-dotenv = "^1.0.0"
|
|
26
26
|
openpyxl = "^3.1.2"
|
|
27
|
+
pywry = "^0.6.2"
|
|
27
28
|
|
|
28
29
|
[build-system]
|
|
29
|
-
requires = ["
|
|
30
|
+
requires = ["poetry-core>=1.0.0"]
|
|
30
31
|
build-backend = "poetry.core.masonry.api"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{openbb_cli-1.1.0 → openbb_cli-1.1.2}/openbb_cli/argparse_translator/argparse_class_processor.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|