Skip to main content

pfund-plot: Financial Charts in One Line of Code

Discord X Downloads PyPI PyPI - Support Python Versions afterpython Discussions Jupyter Notebook Marimo Ask DeepWiki View Code Wiki

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 candlestick streaming example

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:

pfund-plot TradingView Lightweight Charts example

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.

Metadata

Release files for pfund-plot 0.0.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pfund-plot 0.0.5
File Size Uploaded
pfund_plot-0.0.5.tar.gz 125.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pfund-plot 0.0.5
File Interpreter ABI Platform
pfund_plot-0.0.5-py3-none-any.whl Python 3 none any Details

Total release size: 278.8 kB

Release files / pfund_plot-0.0.5.tar.gz

Download URL pfund_plot-0.0.5.tar.gz
Size 125.1 kB
Tags Source
SHA-256 checksum
How to use checksums
c9e0908652d6458733268bff0dd89b50953a520b9f3af649d055e41cf0d14934
BLAKE2b-256 checksum
How to use checksums
a485d925669c989d819bf274af7de30f3ffcf540bcf4526fda9ecc398f9d1959
Upload date
Uploaded using Trusted Publishing?
What is 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}

Release files / pfund_plot-0.0.5-py3-none-any.whl

Download URL pfund_plot-0.0.5-py3-none-any.whl
Size 153.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ddc04b9a4bd035575dee64e04a2d2ce5f1d573f0e71a73e5f654ea5385f90fb2
BLAKE2b-256 checksum
How to use checksums
6d87ac1c36bea8ff9ac72f6cf5e2db24c02f7067c34a4f8419c64401c8bee579
Upload date
Uploaded using Trusted Publishing?
What is 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}
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page