A library for financial data visualization, dashboard creation, and template sharing.
Project description
PFund-Plot: Financial Charts in One Line of Code
This library is NOT ready for use, please wait for 0.1.0 release.
TL;DR: pfund-plot handles the plotting libraries, so traders just get charts that work
Problem
Traders often need to quickly visualize their data without investing time in learning new tools. For example, plotting a candlestick should be as simple as writing a single line of code.
Solution
We created a high-level financial visualization layer that combines the best features from existing plotting libraries into an easy-to-use interface.
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.
Core Features
- Multi-Display Mode: support displaying plots in a Jupyter notebook, Marimo notebook, browser and desktop window
- Intuitive & Chainable API:
plt.ohlc(df).style(...).control(...).mode(...).show() - Streaming Plots: support streaming data in real-time
- DataFrame Agnostic: support pandas, polars, and dask
- Financial Plots: plot financial data by just one function call
- Combine multiple plots into a dashboard quickly for visualization
Installation
pip install pfund-plot
Quickstart
1. Plotting in a Jupyter or Marimo Notebook
To use data sources other than Bybit, please go to pfeed and install the corresponding extras. For example:
pip install "pfeed[data_source1, data_source2]"
import pfeed as pe
import pfund_plot as plt
feed = pe.Bybit().market_feed
result = feed.download(product='BTC_USDT_PERP', resolution='1h', rollback_period='1d')
df = result.data.collect()
# Notebook mode:
plt.ohlc(df)
2. Plotting in a Python Script
# Browser mode:
plt.ohlc(df).mode('browser').show()
# Desktop mode:
if __name__ == "__main__": # Required because desktop mode uses multiprocessing.
plt.ohlc(df).mode('desktop').show()
3. Streaming a Plot
# Streaming requires pipeline_mode=True.
feed = pe.Bybit(pipeline_mode=True).market_feed
feed.stream(product='BTC_USDT_PERP', resolution='1s')
# In a Python script:
plt.ohlc(feed).control(update_interval=1000).mode('browser') # or mode('desktop') under if __name__ == "__main__"
# In a notebook environment (not recommended to start streaming in a notebook unless you know what you're doing):
# await plt.ohlc(feed).control(update_interval=1000).show_async()
Tapping into the JavaScript World
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:
plt.ohlc(df).backend('svelte')
This renders the following chart using TradingView's Lightweight Charts:
This is meant as a showcase rather than a core direction:
pfund-plotremains Python-first, and JavaScript-backed charts are supported where they fit naturally. If you want to bring more useful JavaScript visualizations intopfund-plot, contributions are welcome.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pfund_plot-0.0.1.tar.gz.
File metadata
- Download URL: pfund_plot-0.0.1.tar.gz
- Upload date:
- Size: 124.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.11.0 {"installer":{"name":"uv","version":"0.11.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d0dc562ebf58d484b5074598f91605ea8ea6eb91095ba06114570ba7fbf7cced
|
|
| MD5 |
789a97a56f8b4f3aea9b59128501165f
|
|
| BLAKE2b-256 |
23a0dc4dd191116807835d27dc08102c0512215793b8166526ae9b1b85418d25
|
File details
Details for the file pfund_plot-0.0.1-py3-none-any.whl.
File metadata
- Download URL: pfund_plot-0.0.1-py3-none-any.whl
- Upload date:
- Size: 152.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.11.0 {"installer":{"name":"uv","version":"0.11.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
613e8656278b48c7cad8660207840ff2ab90ca3db8e4852798d5d2efdf40e031
|
|
| MD5 |
a9387dd5435499e8858ec915756d9255
|
|
| BLAKE2b-256 |
38d3989d69a7415f39d547bf70a821bd6b350a27036f053e2bd7163706118793
|