Skip to main content

mplbed

|[]mpl
|======|
|  bed |

mplbed is a library of support code for embedding interactive, server-side matplotlib figures in web applications.

Supporting, in principle any ASGI-compatible Python application, it provides convenient integration for a number of frameworks ones out of the box. It aims to have "usually-works" defaults useful for quick demos, while providing a lot of flexibility and options as well as utilities to deal with advanced issues such as style isolation, and connection and resource management to enable some degree of scaling up to use-cases like internal dashboards.

It can be as easy as:

import mywebframework
from mplbed import mplbed_mywebframework

@mywebframework.route("/myplot")
@mplbed_mywebframework.figure_page
def my_plot_page(request):
    fig, ax = plt.subplots()
    ax.plot([1, 2, 3], [4, 5, 6])
    return fig

app = mywebframework.App(...)
setup(app)

Installation

Currently you can install this package from Github:

$ uv add git+https://github.com/frankier/mplbed

Install the optional NiceGUI integration with:

$ uv add "mplbed[nicegui]"

Then configure the NiceGUI app before ui.run() and create an interactive element with mplbed.integration.nicegui.matplotlib.

Documentation

The docs are published at https://frankier.github.io/mplbed/, which redirects to the newest version. Every release is built under its own version (for example https://frankier.github.io/mplbed/v0.3.0/) and the sidebar links between them.

Contributing

Contributions are welcome. Please discuss any larger changes in the issues before making a pull request to avoid wasted work. You, the human contributor, must personally have reviewed and understood any code submitted.

Set up a dev environment with uv:

$ uv sync --all-groups --all-extras

Run the tests (end-to-end tests need Playwright browsers: uv run playwright install chromium):

$ uv run pytest

Lint, format and typecheck:

$ uv run ruff check ./src
$ uv run ruff format ./src
$ uv run ty check ./src

Install the prek hook to run these automatically on commit:

$ prek install

Build the docs for every version, or only for the working tree:

$ uv run sphinx-polyversion docs/poly.py
$ uv run sphinx-polyversion -l docs/poly.py

Metadata

Release files for mplbed 0.4.0

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

Source distribution (sdist)

Source distribution for mplbed 0.4.0
File Size Uploaded Provenance Actions
mplbed-0.4.0.tar.gz 32.8 kB Without provenance Details for mplbed-0.4.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for mplbed 0.4.0
File Interpreter ABI Platform Actions
mplbed-0.4.0-py3-none-any.whl Python 3 none any Details for mplbed-0.4.0-py3-none-any.whl

Total release size: 74.1 kB

Release files / mplbed-0.4.0.tar.gz

Download URL mplbed-0.4.0.tar.gz
Size 32.8 kB
Tags Source
SHA-256 checksum
How to use checksums
b971789718979e7f15f3270f124cafa763132cf174d5f7a29a25e9d087ded1bf
BLAKE2b-256 checksum
How to use checksums
82534fafe1afa2bd5d1701d26dcef5f0ed4bce86d87f3ee7d35084c94e7a4fbb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.7 {"installer":{"name":"uv","version":"0.13.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / mplbed-0.4.0-py3-none-any.whl

Download URL mplbed-0.4.0-py3-none-any.whl
Size 41.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0b20797b8f838dbaf9fe3fd86fadc43945f876d4b113b8abc6991c709f46ff16
BLAKE2b-256 checksum
How to use checksums
598f10ec5906a242d25a4944eb72cda4d15f2deecfe1049111ea4ebf6291fbf4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.7 {"installer":{"name":"uv","version":"0.13.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for mplbed 0.4.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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