pfund-plot 0.0.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.
Files changed (56) hide show
  1. pfund_plot-0.0.1/PKG-INFO +148 -0
  2. pfund_plot-0.0.1/README.md +99 -0
  3. pfund_plot-0.0.1/pfund_plot/__init__.py +183 -0
  4. pfund_plot-0.0.1/pfund_plot/__main__.py +9 -0
  5. pfund_plot-0.0.1/pfund_plot/cli/__init__.py +3 -0
  6. pfund_plot-0.0.1/pfund_plot/cli/commands/gallery/__init__.py +15 -0
  7. pfund_plot-0.0.1/pfund_plot/cli/commands/gallery/gallery_marimo.py +462 -0
  8. pfund_plot-0.0.1/pfund_plot/cli/commands/serve.py +21 -0
  9. pfund_plot-0.0.1/pfund_plot/cli/main.py +20 -0
  10. pfund_plot-0.0.1/pfund_plot/config.py +109 -0
  11. pfund_plot-0.0.1/pfund_plot/enums/__init__.py +16 -0
  12. pfund_plot-0.0.1/pfund_plot/enums/dataframe_backend.py +6 -0
  13. pfund_plot-0.0.1/pfund_plot/enums/display_mode.py +7 -0
  14. pfund_plot-0.0.1/pfund_plot/enums/panel_design.py +8 -0
  15. pfund_plot-0.0.1/pfund_plot/enums/panel_theme.py +6 -0
  16. pfund_plot-0.0.1/pfund_plot/enums/plotting_backend.py +12 -0
  17. pfund_plot-0.0.1/pfund_plot/js_tap/components/candlestick.js +9566 -0
  18. pfund_plot-0.0.1/pfund_plot/mixins/streaming_market_feed_mixin.py +162 -0
  19. pfund_plot-0.0.1/pfund_plot/plots/altair.py +32 -0
  20. pfund_plot-0.0.1/pfund_plot/plots/area/__init__.py +82 -0
  21. pfund_plot-0.0.1/pfund_plot/plots/area/bokeh.py +151 -0
  22. pfund_plot-0.0.1/pfund_plot/plots/bar/__init__.py +80 -0
  23. pfund_plot-0.0.1/pfund_plot/plots/bar/bokeh.py +128 -0
  24. pfund_plot-0.0.1/pfund_plot/plots/bokeh.py +32 -0
  25. pfund_plot-0.0.1/pfund_plot/plots/candlestick/__init__.py +77 -0
  26. pfund_plot-0.0.1/pfund_plot/plots/candlestick/bokeh.py +124 -0
  27. pfund_plot-0.0.1/pfund_plot/plots/candlestick/svelte.py +161 -0
  28. pfund_plot-0.0.1/pfund_plot/plots/holoviews.py +32 -0
  29. pfund_plot-0.0.1/pfund_plot/plots/label/__init__.py +43 -0
  30. pfund_plot-0.0.1/pfund_plot/plots/label/bokeh.py +89 -0
  31. pfund_plot-0.0.1/pfund_plot/plots/layout/__init__.py +98 -0
  32. pfund_plot-0.0.1/pfund_plot/plots/layout/layout.py +116 -0
  33. pfund_plot-0.0.1/pfund_plot/plots/layout/panel.py +51 -0
  34. pfund_plot-0.0.1/pfund_plot/plots/layout/tabs/__init__.py +36 -0
  35. pfund_plot-0.0.1/pfund_plot/plots/layout/tabs/panel.py +51 -0
  36. pfund_plot-0.0.1/pfund_plot/plots/lazy.py +408 -0
  37. pfund_plot-0.0.1/pfund_plot/plots/line/__init__.py +37 -0
  38. pfund_plot-0.0.1/pfund_plot/plots/line/bokeh.py +137 -0
  39. pfund_plot-0.0.1/pfund_plot/plots/matplotlib.py +32 -0
  40. pfund_plot-0.0.1/pfund_plot/plots/plot.py +1131 -0
  41. pfund_plot-0.0.1/pfund_plot/plots/plotly.py +32 -0
  42. pfund_plot-0.0.1/pfund_plot/plots/scatter/__init__.py +62 -0
  43. pfund_plot-0.0.1/pfund_plot/plots/scatter/bokeh.py +158 -0
  44. pfund_plot-0.0.1/pfund_plot/plots/scatter/marker.py +107 -0
  45. pfund_plot-0.0.1/pfund_plot/plots/ta.py +6 -0
  46. pfund_plot-0.0.1/pfund_plot/renderers/base.py +84 -0
  47. pfund_plot-0.0.1/pfund_plot/renderers/browser.py +28 -0
  48. pfund_plot-0.0.1/pfund_plot/renderers/desktop.py +109 -0
  49. pfund_plot-0.0.1/pfund_plot/renderers/notebook.py +92 -0
  50. pfund_plot-0.0.1/pfund_plot/typing.py +29 -0
  51. pfund_plot-0.0.1/pfund_plot/utils/__init__.py +176 -0
  52. pfund_plot-0.0.1/pfund_plot/utils/bokeh.py +177 -0
  53. pfund_plot-0.0.1/pfund_plot/widgets/base.py +76 -0
  54. pfund_plot-0.0.1/pfund_plot/widgets/datetime_widget.py +221 -0
  55. pfund_plot-0.0.1/pfund_plot/widgets/ticker_widget.py +82 -0
  56. pfund_plot-0.0.1/pyproject.toml +85 -0
@@ -0,0 +1,148 @@
1
+ Metadata-Version: 2.4
2
+ Name: pfund-plot
3
+ Version: 0.0.1
4
+ Summary: A library for financial data visualization, dashboard creation, and template sharing.
5
+ Keywords: financial data,plotting,dashboards,charts,data visualization,graphs,plots
6
+ Author: Stephen Yau
7
+ Author-email: Stephen Yau <softwareentrepreneer+pfund-plot@gmail.com>
8
+ License-Expression: Apache-2.0
9
+ Classifier: Operating System :: OS Independent
10
+ Classifier: Intended Audience :: Developers
11
+ Classifier: Intended Audience :: Science/Research
12
+ Classifier: Intended Audience :: Financial and Insurance Industry
13
+ Classifier: Intended Audience :: Information Technology
14
+ Classifier: Topic :: Office/Business :: Financial :: Investment
15
+ Classifier: Topic :: Scientific/Engineering :: Visualization
16
+ Classifier: Topic :: Software Development :: Libraries
17
+ Classifier: Typing :: Typed
18
+ Classifier: Programming Language :: Python :: 3.11
19
+ Classifier: Programming Language :: Python :: 3.12
20
+ Classifier: Programming Language :: Python :: 3.13
21
+ Requires-Dist: pfeed>=0.0.15
22
+ Requires-Dist: panel>=1.9.3
23
+ Requires-Dist: hvplot>=0.12.2
24
+ Requires-Dist: dayplot>=0.5.1
25
+ Requires-Dist: anywidget>=0.11.0 ; sys_platform != 'emscripten'
26
+ Requires-Dist: ipywidgets-bokeh>=1.7.0 ; sys_platform != 'emscripten'
27
+ Requires-Dist: pywebview>=6.2.1 ; sys_platform != 'emscripten'
28
+ Requires-Dist: datashader>=0.19.1 ; sys_platform != 'emscripten'
29
+ Requires-Dist: altair>=6.1.0 ; extra == 'altair'
30
+ Requires-Dist: vegafusion>=2.0.3 ; extra == 'altair'
31
+ Requires-Dist: vl-convert-python>=1.9.0.post1 ; extra == 'altair'
32
+ Requires-Dist: jupyter-bokeh>=4.0.5 ; extra == 'jupyter'
33
+ Requires-Dist: notebook>=7.5.7 ; extra == 'jupyter'
34
+ Requires-Dist: papermill>=2.7.0 ; extra == 'jupyter'
35
+ Requires-Dist: voila>=0.5.12 ; extra == 'jupyter'
36
+ Requires-Dist: marimo[recommended,lsp]>=0.23.9 ; extra == 'marimo'
37
+ Requires-Dist: matplotlib>=3.10.9 ; extra == 'matplotlib'
38
+ Requires-Dist: plotly>=6.8.0 ; extra == 'plotly'
39
+ Requires-Python: >=3.11
40
+ Project-URL: homepage, https://pfund-plot.pfund.ai
41
+ Project-URL: repository, https://github.com/PFund-Software-Ltd/pfund-plot
42
+ Project-URL: documentation, https://pfund-plot.pfund.ai/doc
43
+ Provides-Extra: altair
44
+ Provides-Extra: jupyter
45
+ Provides-Extra: marimo
46
+ Provides-Extra: matplotlib
47
+ Provides-Extra: plotly
48
+ Description-Content-Type: text/markdown
49
+
50
+ # PFund-Plot: Financial Charts in One Line of Code
51
+
52
+ [![Discord](https://img.shields.io/badge/Discord-%235865F2.svg?logo=discord&logoColor=white)](https://discord.gg/vqpS94tpdp)
53
+ [![X](https://img.shields.io/twitter/follow/pfund_ai?style=social)](https://x.com/pfund_ai)
54
+ [![Downloads](https://static.pepy.tech/badge/pfund-plot/month)](https://pepy.tech/project/pfund-plot)
55
+ [![PyPI](https://img.shields.io/pypi/v/pfund-plot.svg?cacheSeconds=300)](https://pypi.org/project/pfund-plot)
56
+ ![PyPI - Support Python Versions](https://img.shields.io/pypi/pyversions/pfund-plot?cacheSeconds=300)
57
+ [![afterpython](https://afterpython.org/shield.svg)](https://afterpython.org)
58
+ [![Discussions](https://img.shields.io/badge/Discussions-Let's%20Chat-green)](https://github.com/PFund-Software-Ltd/pfund-plot/discussions)
59
+ [![Jupyter Notebook](https://img.shields.io/badge/jupyter-notebook-orange?logo=jupyter)](https://jupyter.org)
60
+ [![Marimo](https://marimo.io/shield.svg)](https://marimo.io)
61
+ [![Ask DeepWiki](https://deepwiki.com/badge.svg)](https://deepwiki.com/PFund-Software-Ltd/pfund-plot)
62
+ [![View Code Wiki](https://assets.codewiki.google/readme-badge/static.svg)](https://codewiki.google/github.com/pfund-software-ltd/pfund-plot?utm_source=badge&utm_medium=github&utm_campaign=github.com/pfund-software-ltd/pfund-plot)
63
+ <!-- ![PyPI downloads](https://img.shields.io/pypi/dm/pfund-plot?label=downloads&cacheSeconds=86400) -->
64
+ <!-- ![GitHub stars](https://img.shields.io/github/stars/PFund-Software-Ltd/pfund-plot?style=social) -->
65
+
66
+
67
+ > **This library is NOT ready for use, please wait for 0.1.0 release.**
68
+
69
+ ## TL;DR: pfund-plot handles the plotting libraries, so traders just get charts that work
70
+
71
+ ## Problem
72
+ Traders often need to quickly visualize their data without investing time in learning new tools.
73
+ For example, plotting a candlestick should be as simple as writing a single line of code.
74
+
75
+ ## Solution
76
+ We created a high-level financial visualization layer that combines the best features from existing plotting libraries into an easy-to-use interface.
77
+
78
+ ---
79
+ <img src="afterpython/static/candlestick.gif" alt="pfund-plot candlestick streaming example" width="450">
80
+
81
+ ---
82
+
83
+ `pfund-plot` is a financial visualization layer on top of existing plotting libraries, giving traders a simple, domain-specific interface for plotting and streaming market data.
84
+
85
+ ## Core Features
86
+ - [x] Multi-Display Mode: support displaying plots in a *Jupyter notebook*, *Marimo notebook*, *browser* and *desktop window*
87
+ - [x] Intuitive & Chainable API: `plt.ohlc(df).style(...).control(...).mode(...).show()`
88
+ - [x] Streaming Plots: support streaming data in real-time
89
+ - [x] DataFrame Agnostic: support pandas, polars, and dask
90
+ - [x] Financial Plots: plot financial data by just one function call
91
+ - [x] Combine multiple plots into a dashboard quickly for visualization
92
+
93
+
94
+ ## Installation
95
+ ```bash
96
+ pip install pfund-plot
97
+ ```
98
+
99
+ ## Quickstart
100
+ ### 1. Plotting in a Jupyter or Marimo Notebook
101
+ > To use data sources other than Bybit, please go to [pfeed](https://github.com/PFund-Software-Ltd/pfeed) and install the corresponding extras. For example: `pip install "pfeed[data_source1, data_source2]"`
102
+ ```python
103
+ import pfeed as pe
104
+ import pfund_plot as plt
105
+
106
+ feed = pe.Bybit().market_feed
107
+ result = feed.download(product='BTC_USDT_PERP', resolution='1h', rollback_period='1d')
108
+ df = result.data.collect()
109
+
110
+ # Notebook mode:
111
+ plt.ohlc(df)
112
+ ```
113
+
114
+ ### 2. Plotting in a Python Script
115
+ ```python
116
+ # Browser mode:
117
+ plt.ohlc(df).mode('browser').show()
118
+
119
+ # Desktop mode:
120
+ if __name__ == "__main__": # Required because desktop mode uses multiprocessing.
121
+ plt.ohlc(df).mode('desktop').show()
122
+ ```
123
+
124
+ ### 3. Streaming a Plot
125
+ ```python
126
+ # Streaming requires pipeline_mode=True.
127
+ feed = pe.Bybit(pipeline_mode=True).market_feed
128
+ feed.stream(product='BTC_USDT_PERP', resolution='1s')
129
+
130
+ # In a Python script:
131
+ plt.ohlc(feed).control(update_interval=1000).mode('browser') # or mode('desktop') under if __name__ == "__main__"
132
+
133
+ # In a notebook environment (not recommended to start streaming in a notebook unless you know what you're doing):
134
+ # await plt.ohlc(feed).control(update_interval=1000).show_async()
135
+ ```
136
+
137
+ ---
138
+
139
+ ## Tapping into the JavaScript World
140
+ Python developers sometimes envy the JavaScript visualization ecosystem for its rich set of interactive charts and dashboards. With `pfund-plot`, they can still enjoy the benefits of the JavaScript world while keeping the same Python-first API. For example:
141
+ ```python
142
+ plt.ohlc(df).backend('svelte')
143
+ ```
144
+ This renders the following chart using TradingView's [Lightweight Charts](https://github.com/tradingview/lightweight-charts):
145
+
146
+ <img src="afterpython/static/tradingview.png" alt="pfund-plot TradingView Lightweight Charts example" width="450">
147
+
148
+ > This is meant as a showcase rather than a core direction: `pfund-plot` remains Python-first, and JavaScript-backed charts are supported where they fit naturally. If you want to bring more useful JavaScript visualizations into `pfund-plot`, contributions are welcome.
@@ -0,0 +1,99 @@
1
+ # PFund-Plot: Financial Charts in One Line of Code
2
+
3
+ [![Discord](https://img.shields.io/badge/Discord-%235865F2.svg?logo=discord&logoColor=white)](https://discord.gg/vqpS94tpdp)
4
+ [![X](https://img.shields.io/twitter/follow/pfund_ai?style=social)](https://x.com/pfund_ai)
5
+ [![Downloads](https://static.pepy.tech/badge/pfund-plot/month)](https://pepy.tech/project/pfund-plot)
6
+ [![PyPI](https://img.shields.io/pypi/v/pfund-plot.svg?cacheSeconds=300)](https://pypi.org/project/pfund-plot)
7
+ ![PyPI - Support Python Versions](https://img.shields.io/pypi/pyversions/pfund-plot?cacheSeconds=300)
8
+ [![afterpython](https://afterpython.org/shield.svg)](https://afterpython.org)
9
+ [![Discussions](https://img.shields.io/badge/Discussions-Let's%20Chat-green)](https://github.com/PFund-Software-Ltd/pfund-plot/discussions)
10
+ [![Jupyter Notebook](https://img.shields.io/badge/jupyter-notebook-orange?logo=jupyter)](https://jupyter.org)
11
+ [![Marimo](https://marimo.io/shield.svg)](https://marimo.io)
12
+ [![Ask DeepWiki](https://deepwiki.com/badge.svg)](https://deepwiki.com/PFund-Software-Ltd/pfund-plot)
13
+ [![View Code Wiki](https://assets.codewiki.google/readme-badge/static.svg)](https://codewiki.google/github.com/pfund-software-ltd/pfund-plot?utm_source=badge&utm_medium=github&utm_campaign=github.com/pfund-software-ltd/pfund-plot)
14
+ <!-- ![PyPI downloads](https://img.shields.io/pypi/dm/pfund-plot?label=downloads&cacheSeconds=86400) -->
15
+ <!-- ![GitHub stars](https://img.shields.io/github/stars/PFund-Software-Ltd/pfund-plot?style=social) -->
16
+
17
+
18
+ > **This library is NOT ready for use, please wait for 0.1.0 release.**
19
+
20
+ ## TL;DR: pfund-plot handles the plotting libraries, so traders just get charts that work
21
+
22
+ ## Problem
23
+ Traders often need to quickly visualize their data without investing time in learning new tools.
24
+ For example, plotting a candlestick should be as simple as writing a single line of code.
25
+
26
+ ## Solution
27
+ We created a high-level financial visualization layer that combines the best features from existing plotting libraries into an easy-to-use interface.
28
+
29
+ ---
30
+ <img src="afterpython/static/candlestick.gif" alt="pfund-plot candlestick streaming example" width="450">
31
+
32
+ ---
33
+
34
+ `pfund-plot` is a financial visualization layer on top of existing plotting libraries, giving traders a simple, domain-specific interface for plotting and streaming market data.
35
+
36
+ ## Core Features
37
+ - [x] Multi-Display Mode: support displaying plots in a *Jupyter notebook*, *Marimo notebook*, *browser* and *desktop window*
38
+ - [x] Intuitive & Chainable API: `plt.ohlc(df).style(...).control(...).mode(...).show()`
39
+ - [x] Streaming Plots: support streaming data in real-time
40
+ - [x] DataFrame Agnostic: support pandas, polars, and dask
41
+ - [x] Financial Plots: plot financial data by just one function call
42
+ - [x] Combine multiple plots into a dashboard quickly for visualization
43
+
44
+
45
+ ## Installation
46
+ ```bash
47
+ pip install pfund-plot
48
+ ```
49
+
50
+ ## Quickstart
51
+ ### 1. Plotting in a Jupyter or Marimo Notebook
52
+ > To use data sources other than Bybit, please go to [pfeed](https://github.com/PFund-Software-Ltd/pfeed) and install the corresponding extras. For example: `pip install "pfeed[data_source1, data_source2]"`
53
+ ```python
54
+ import pfeed as pe
55
+ import pfund_plot as plt
56
+
57
+ feed = pe.Bybit().market_feed
58
+ result = feed.download(product='BTC_USDT_PERP', resolution='1h', rollback_period='1d')
59
+ df = result.data.collect()
60
+
61
+ # Notebook mode:
62
+ plt.ohlc(df)
63
+ ```
64
+
65
+ ### 2. Plotting in a Python Script
66
+ ```python
67
+ # Browser mode:
68
+ plt.ohlc(df).mode('browser').show()
69
+
70
+ # Desktop mode:
71
+ if __name__ == "__main__": # Required because desktop mode uses multiprocessing.
72
+ plt.ohlc(df).mode('desktop').show()
73
+ ```
74
+
75
+ ### 3. Streaming a Plot
76
+ ```python
77
+ # Streaming requires pipeline_mode=True.
78
+ feed = pe.Bybit(pipeline_mode=True).market_feed
79
+ feed.stream(product='BTC_USDT_PERP', resolution='1s')
80
+
81
+ # In a Python script:
82
+ plt.ohlc(feed).control(update_interval=1000).mode('browser') # or mode('desktop') under if __name__ == "__main__"
83
+
84
+ # In a notebook environment (not recommended to start streaming in a notebook unless you know what you're doing):
85
+ # await plt.ohlc(feed).control(update_interval=1000).show_async()
86
+ ```
87
+
88
+ ---
89
+
90
+ ## Tapping into the JavaScript World
91
+ Python developers sometimes envy the JavaScript visualization ecosystem for its rich set of interactive charts and dashboards. With `pfund-plot`, they can still enjoy the benefits of the JavaScript world while keeping the same Python-first API. For example:
92
+ ```python
93
+ plt.ohlc(df).backend('svelte')
94
+ ```
95
+ This renders the following chart using TradingView's [Lightweight Charts](https://github.com/tradingview/lightweight-charts):
96
+
97
+ <img src="afterpython/static/tradingview.png" alt="pfund-plot TradingView Lightweight Charts example" width="450">
98
+
99
+ > This is meant as a showcase rather than a core direction: `pfund-plot` remains Python-first, and JavaScript-backed charts are supported where they fit naturally. If you want to bring more useful JavaScript visualizations into `pfund-plot`, contributions are welcome.
@@ -0,0 +1,183 @@
1
+ from __future__ import annotations
2
+
3
+ from typing import TYPE_CHECKING
4
+
5
+ if TYPE_CHECKING:
6
+ from pfund_plot.plots.altair import (
7
+ Altair as altair,
8
+ )
9
+ from pfund_plot.plots.altair import (
10
+ Altair as vega,
11
+ )
12
+ from pfund_plot.plots.area import (
13
+ Area as area,
14
+ )
15
+ from pfund_plot.plots.bar import (
16
+ Bar as bar,
17
+ )
18
+ from pfund_plot.plots.bokeh import (
19
+ Bokeh as bokeh,
20
+ )
21
+ from pfund_plot.plots.candlestick import (
22
+ Candlestick as candlestick,
23
+ )
24
+ from pfund_plot.plots.candlestick import (
25
+ Candlestick as kline,
26
+ )
27
+ from pfund_plot.plots.candlestick import (
28
+ Candlestick as ohlc,
29
+ )
30
+ from pfund_plot.plots.holoviews import (
31
+ Holoviews as holoviews,
32
+ )
33
+ from pfund_plot.plots.holoviews import (
34
+ Holoviews as hv,
35
+ )
36
+ from pfund_plot.plots.label import (
37
+ Label as label,
38
+ )
39
+ from pfund_plot.plots.layout import (
40
+ Layout as layout,
41
+ )
42
+ from pfund_plot.plots.layout.tabs import (
43
+ Tabs as tabs,
44
+ )
45
+ from pfund_plot.plots.line import (
46
+ Line as line,
47
+ )
48
+ from pfund_plot.plots.matplotlib import (
49
+ Matplotlib as matplotlib,
50
+ )
51
+ from pfund_plot.plots.matplotlib import (
52
+ Matplotlib as mpl,
53
+ )
54
+ from pfund_plot.plots.plotly import (
55
+ Plotly as plotly,
56
+ )
57
+ from pfund_plot.plots.scatter import (
58
+ Scatter as scatter,
59
+ )
60
+ from pfund_plot.plots.scatter.marker import (
61
+ Marker as marker,
62
+ )
63
+
64
+ # NOTE: data update in anywidget (backend=svelte) may have issues (especially in marimo) after loading panel extensions
65
+ # if anywidget+svelte backend is not working, try to comment this out
66
+ #
67
+ # plotly/vega resolve to panel.models.* (bundled with Panel) — they don't import the
68
+ # plotly/altair libs, so they're safe even when those optional extras aren't installed.
69
+ # "ipywidgets" pulls in panel.io.ipywidget -> ipywidgets_bokeh, which is absent in WASM
70
+ # (and where the anywidget/svelte backend isn't available anyway), so guard only that one.
71
+ import importlib.util
72
+
73
+ import panel as pn
74
+
75
+ from pfund_plot.config import configure, get_config
76
+
77
+ _panel_extensions = ["plotly", "vega"]
78
+ if importlib.util.find_spec("ipywidgets_bokeh") is not None:
79
+ _panel_extensions.append("ipywidgets")
80
+ pn.extension(*_panel_extensions)
81
+ # NOTE: this MUST be True, otherwise, some widgets won't work properly, e.g. candlestick widgets, slider and input will both trigger each other due to panel's async update, which leads to infinite loop.
82
+ pn.config.throttled = (
83
+ True # If panel sliders and inputs should be throttled until release of mouse.
84
+ )
85
+ # NOTE: /assets can only be recognized when setting pn.serve(static_dirs=pfund_plot.config.static_dirs)
86
+ # see static_dirs in config.py
87
+ # pn.config.js_files = {
88
+ # "your_custom_js_file": "/assets/your_custom_js_file.js",
89
+ # }
90
+
91
+
92
+ def __getattr__(name: str):
93
+ if name == "__version__":
94
+ from importlib.metadata import version
95
+
96
+ return version("pfund_plot")
97
+ elif name == "plotly":
98
+ from pfund_plot.plots.plotly import Plotly
99
+
100
+ return Plotly
101
+ elif name in ("candlestick", "ohlc", "kline"):
102
+ from pfund_plot.plots.candlestick import Candlestick
103
+
104
+ return Candlestick
105
+ elif name == "line":
106
+ from pfund_plot.plots.line import Line
107
+
108
+ return Line
109
+ elif name == "area":
110
+ from pfund_plot.plots.area import Area
111
+
112
+ return Area
113
+ elif name == "layout":
114
+ from pfund_plot.plots.layout import Layout
115
+
116
+ return Layout
117
+ elif name == "tabs":
118
+ from pfund_plot.plots.layout.tabs import Tabs
119
+
120
+ return Tabs
121
+ elif name == "scatter":
122
+ from pfund_plot.plots.scatter import Scatter
123
+
124
+ return Scatter
125
+ elif name == "marker":
126
+ from pfund_plot.plots.scatter.marker import Marker
127
+
128
+ return Marker
129
+ elif name == "label":
130
+ from pfund_plot.plots.label import Label
131
+
132
+ return Label
133
+ elif name == "bar":
134
+ from pfund_plot.plots.bar import Bar
135
+
136
+ return Bar
137
+ elif name in ("altair", "vega"):
138
+ from pfund_plot.plots.altair import Altair
139
+
140
+ return Altair
141
+ elif name in ("matplotlib", "mpl"):
142
+ from pfund_plot.plots.matplotlib import Matplotlib
143
+
144
+ return Matplotlib
145
+ elif name == "bokeh":
146
+ from pfund_plot.plots.bokeh import Bokeh
147
+
148
+ return Bokeh
149
+ elif name in ("holoviews", "hv"):
150
+ from pfund_plot.plots.holoviews import Holoviews
151
+
152
+ return Holoviews
153
+ else:
154
+ raise AttributeError(f"'{__name__}' has no attribute '{name}'")
155
+
156
+
157
+ __all__ = (
158
+ "altair",
159
+ "area",
160
+ "bar",
161
+ "bokeh",
162
+ "candlestick",
163
+ "configure",
164
+ "get_config",
165
+ "holoviews",
166
+ "hv",
167
+ "kline",
168
+ "label",
169
+ "layout",
170
+ "line",
171
+ "marker",
172
+ "matplotlib",
173
+ "mpl",
174
+ "ohlc",
175
+ "plotly",
176
+ "scatter",
177
+ "tabs",
178
+ "vega",
179
+ )
180
+
181
+
182
+ def __dir__():
183
+ return sorted(__all__)
@@ -0,0 +1,9 @@
1
+ def run_cli() -> None:
2
+ """Application Entrypoint."""
3
+ from pfund_plot.cli import pfund_plot_group
4
+
5
+ pfund_plot_group(obj={})
6
+
7
+
8
+ if __name__ == "__main__":
9
+ run_cli()
@@ -0,0 +1,3 @@
1
+ from pfund_plot.cli.main import pfund_plot_group
2
+
3
+ __all__ = ["pfund_plot_group"]
@@ -0,0 +1,15 @@
1
+ import subprocess
2
+ import sys
3
+ from pathlib import Path
4
+
5
+ import click
6
+
7
+ GALLERY_DIR = Path(__file__).parent
8
+
9
+
10
+ @click.command(hidden=True)
11
+ def gallery():
12
+ """Open the gallery to visually verify all supported plots."""
13
+ script = GALLERY_DIR / "gallery_marimo.py"
14
+ result = subprocess.run(["marimo", "edit", str(script)], check=False)
15
+ sys.exit(result.returncode)