openbb-charting 2.2.1__tar.gz → 2.2.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.
Files changed (56) hide show
  1. {openbb_charting-2.2.1 → openbb_charting-2.2.2}/PKG-INFO +2 -2
  2. {openbb_charting-2.2.1 → openbb_charting-2.2.2}/openbb_charting/charting.py +28 -0
  3. {openbb_charting-2.2.1 → openbb_charting-2.2.2}/openbb_charting/core/backend.py +1 -1
  4. {openbb_charting-2.2.1 → openbb_charting-2.2.2}/pyproject.toml +2 -2
  5. openbb_charting-2.2.1/openbb_charting/_charting_router.py +0 -860
  6. openbb_charting-2.2.1/openbb_charting/_query_params.py +0 -96
  7. openbb_charting-2.2.1/openbb_charting/charts/py.typed +0 -0
  8. openbb_charting-2.2.1/openbb_charting/core/assets/plotly.min.js +0 -8
  9. openbb_charting-2.2.1/openbb_charting/core/config/py.typed +0 -0
  10. openbb_charting-2.2.1/openbb_charting/core/plotly_old.html +0 -3621
  11. openbb_charting-2.2.1/openbb_charting/core/plotly_ta/not_singleton_ta_class.py +0 -601
  12. openbb_charting-2.2.1/openbb_charting/core/plotly_ta/py.typed +0 -0
  13. openbb_charting-2.2.1/openbb_charting/core/py.typed +0 -0
  14. openbb_charting-2.2.1/openbb_charting/core/table copy.html +0 -329
  15. openbb_charting-2.2.1/openbb_charting/frontend-components/tables/package.json +0 -51
  16. openbb_charting-2.2.1/openbb_charting/py.typed +0 -0
  17. openbb_charting-2.2.1/openbb_charting/styles/colors.txt +0 -35
  18. openbb_charting-2.2.1/openbb_charting/styles/py.typed +0 -0
  19. openbb_charting-2.2.1/openbb_charting/utils/field_style.py +0 -280
  20. {openbb_charting-2.2.1 → openbb_charting-2.2.2}/README.md +0 -0
  21. {openbb_charting-2.2.1 → openbb_charting-2.2.2}/openbb_charting/__init__.py +0 -0
  22. {openbb_charting-2.2.1 → openbb_charting-2.2.2}/openbb_charting/charts/__init__.py +0 -0
  23. {openbb_charting-2.2.1 → openbb_charting-2.2.2}/openbb_charting/charts/generic_charts.py +0 -0
  24. {openbb_charting-2.2.1 → openbb_charting-2.2.2}/openbb_charting/charts/helpers.py +0 -0
  25. {openbb_charting-2.2.1 → openbb_charting-2.2.2}/openbb_charting/charts/price_historical.py +0 -0
  26. {openbb_charting-2.2.1 → openbb_charting-2.2.2}/openbb_charting/charts/price_performance.py +0 -0
  27. {openbb_charting-2.2.1 → openbb_charting-2.2.2}/openbb_charting/charts/relative_rotation.py +0 -0
  28. {openbb_charting-2.2.1 → openbb_charting-2.2.2}/openbb_charting/core/__init__.py +0 -0
  29. {openbb_charting-2.2.1 → openbb_charting-2.2.2}/openbb_charting/core/assets/Terminal_icon.png +0 -0
  30. {openbb_charting-2.2.1 → openbb_charting-2.2.2}/openbb_charting/core/assets/plotly-2.32.0.min.js +0 -0
  31. {openbb_charting-2.2.1 → openbb_charting-2.2.2}/openbb_charting/core/chart_style.py +0 -0
  32. {openbb_charting-2.2.1 → openbb_charting-2.2.2}/openbb_charting/core/config/__init__.py +0 -0
  33. {openbb_charting-2.2.1 → openbb_charting-2.2.2}/openbb_charting/core/config/openbb_styles.py +0 -0
  34. {openbb_charting-2.2.1 → openbb_charting-2.2.2}/openbb_charting/core/dummy_backend.py +0 -0
  35. {openbb_charting-2.2.1 → openbb_charting-2.2.2}/openbb_charting/core/openbb_figure.py +0 -0
  36. {openbb_charting-2.2.1 → openbb_charting-2.2.2}/openbb_charting/core/plotly.html +0 -0
  37. {openbb_charting-2.2.1 → openbb_charting-2.2.2}/openbb_charting/core/plotly_ta/__init__.py +0 -0
  38. {openbb_charting-2.2.1 → openbb_charting-2.2.2}/openbb_charting/core/plotly_ta/base.py +0 -0
  39. {openbb_charting-2.2.1 → openbb_charting-2.2.2}/openbb_charting/core/plotly_ta/data_classes.py +0 -0
  40. {openbb_charting-2.2.1 → openbb_charting-2.2.2}/openbb_charting/core/plotly_ta/plugins/__init__.py +0 -0
  41. {openbb_charting-2.2.1 → openbb_charting-2.2.2}/openbb_charting/core/plotly_ta/plugins/custom_indicators_plugin.py +0 -0
  42. {openbb_charting-2.2.1 → openbb_charting-2.2.2}/openbb_charting/core/plotly_ta/plugins/momentum_plugin.py +0 -0
  43. {openbb_charting-2.2.1 → openbb_charting-2.2.2}/openbb_charting/core/plotly_ta/plugins/overlap_plugin.py +0 -0
  44. {openbb_charting-2.2.1 → openbb_charting-2.2.2}/openbb_charting/core/plotly_ta/plugins/trend_indicators_plugin.py +0 -0
  45. {openbb_charting-2.2.1 → openbb_charting-2.2.2}/openbb_charting/core/plotly_ta/plugins/volatility_plugin.py +0 -0
  46. {openbb_charting-2.2.1 → openbb_charting-2.2.2}/openbb_charting/core/plotly_ta/plugins/volume_plugin.py +0 -0
  47. {openbb_charting-2.2.1 → openbb_charting-2.2.2}/openbb_charting/core/plotly_ta/ta_class.py +0 -0
  48. {openbb_charting-2.2.1 → openbb_charting-2.2.2}/openbb_charting/core/plotly_ta/ta_helpers.py +0 -0
  49. {openbb_charting-2.2.1 → openbb_charting-2.2.2}/openbb_charting/core/table.html +0 -0
  50. {openbb_charting-2.2.1 → openbb_charting-2.2.2}/openbb_charting/core/to_chart.py +0 -0
  51. {openbb_charting-2.2.1 → openbb_charting-2.2.2}/openbb_charting/query_params.py +0 -0
  52. {openbb_charting-2.2.1 → openbb_charting-2.2.2}/openbb_charting/styles/__init__.py +0 -0
  53. {openbb_charting-2.2.1 → openbb_charting-2.2.2}/openbb_charting/styles/colors.py +0 -0
  54. {openbb_charting-2.2.1 → openbb_charting-2.2.2}/openbb_charting/styles/default/dark.pltstyle.json +0 -0
  55. {openbb_charting-2.2.1 → openbb_charting-2.2.2}/openbb_charting/styles/default/light.pltstyle.json +0 -0
  56. {openbb_charting-2.2.1 → openbb_charting-2.2.2}/openbb_charting/styles/default/tables.pltstyle.json +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: openbb-charting
3
- Version: 2.2.1
3
+ Version: 2.2.2
4
4
  Summary: Charting extension for OpenBB
5
5
  License: AGPL-3.0-only
6
6
  Author: OpenBB Team
@@ -15,7 +15,7 @@ Classifier: Programming Language :: Python :: 3.12
15
15
  Provides-Extra: pywry
16
16
  Requires-Dist: nbformat (>=5.9.2,<6.0.0)
17
17
  Requires-Dist: numpy (>=1,<2)
18
- Requires-Dist: openbb-core (>=1.3.1,<2.0.0)
18
+ Requires-Dist: openbb-core (>=1.3.2,<2.0.0)
19
19
  Requires-Dist: pandas-ta (>=0.3.14b,<0.4.0)
20
20
  Requires-Dist: plotly (>=5.17.0,<6.0.0)
21
21
  Requires-Dist: pywry (>=0.6.1,<0.7.0) ; extra == "pywry"
@@ -546,6 +546,32 @@ class Charting:
546
546
  external=True
547
547
  ).to_plotly_json()
548
548
 
549
+ @staticmethod
550
+ def _convert_to_string(x):
551
+ """Sanitize the data for the table."""
552
+ # pylint: disable=import-outside-toplevel
553
+ from numpy import isnan
554
+
555
+ if isinstance(x, (float, int)) and not isnan(x):
556
+ return x
557
+ if isinstance(x, dict):
558
+ return ", ".join([str(v) for v in x.values()])
559
+ if isinstance(x, list):
560
+ if all(isinstance(i, dict) for i in x):
561
+ return ", ".join(
562
+ str(", ".join([str(v) for v in i.values()])) for i in x
563
+ )
564
+ return ", ".join([str(i) for i in x])
565
+
566
+ return (
567
+ str(x)
568
+ .replace("[", "")
569
+ .replace("]", "")
570
+ .replace("'{", "")
571
+ .replace("}'", "")
572
+ .replace("nan", "")
573
+ )
574
+
549
575
  def table(
550
576
  self,
551
577
  data: Optional[Union["DataFrame", "Series"]] = None,
@@ -569,6 +595,8 @@ class Charting:
569
595
  data_as_df.reset_index(inplace=True, drop=True)
570
596
  else:
571
597
  data_as_df.reset_index(inplace=True)
598
+ for col in data_as_df.columns:
599
+ data_as_df[col] = data_as_df[col].apply(self._convert_to_string)
572
600
  if self._backend.isatty:
573
601
  try:
574
602
  self._backend.send_table(
@@ -416,7 +416,7 @@ async def download_plotly_js():
416
416
  # we use aiohttp to download plotly.js
417
417
  # this is so we don't have to block the main thread
418
418
  async with aiohttp.ClientSession(
419
- connector=aiohttp.TCPConnector(verify_ssl=False)
419
+ connector=aiohttp.TCPConnector(verify_ssl=False), trust_env=True
420
420
  ) as session, session.get(f"https://cdn.plot.ly/{js_filename}") as resp:
421
421
  with open(str(PLOTLYJS_PATH), "wb") as f:
422
422
  while True:
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "openbb-charting"
3
- version = "2.2.1"
3
+ version = "2.2.2"
4
4
  description = "Charting extension for OpenBB"
5
5
  authors = ["OpenBB Team <hello@openbb.co>"]
6
6
  license = "AGPL-3.0-only"
@@ -15,7 +15,7 @@ statsmodels = "^0.14.0"
15
15
  pywry = { version = "^0.6.1", optional = true }
16
16
  nbformat = "^5.9.2"
17
17
  pandas-ta = "^0.3.14b"
18
- openbb-core = "^1.3.1"
18
+ openbb-core = "^1.3.2"
19
19
  numpy = "^1"
20
20
 
21
21
  [tool.poetry.extras]