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

Documentation

The documentation includes API docs and examples.

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

Metadata

Release files for mplbed 0.1.1

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.1.1
File Size Uploaded
mplbed-0.1.1.tar.gz 14.5 kB Details

Built distribution (wheel)

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

Total release size: 35.2 kB

Release files / mplbed-0.1.1.tar.gz

Download URL mplbed-0.1.1.tar.gz
Size 14.5 kB
Tags Source
SHA-256 checksum
How to use checksums
0d2515d6f30f0689722c3c7a9e75c0b33d377f2c67e3afeb9437560bd33bba8f
BLAKE2b-256 checksum
How to use checksums
52fb67ef0042fac7771f7ddd51acf1664b22bd24a9dfa76e3d1581881083e0ef
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.11.32 {"installer":{"name":"uv","version":"0.11.32","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 / mplbed-0.1.1-py3-none-any.whl

Download URL mplbed-0.1.1-py3-none-any.whl
Size 20.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
094a243281acca38f6c47e606eda9fda784aa86c58a4ee889b070a0a29fcf380
BLAKE2b-256 checksum
How to use checksums
360721b6d9b377c71bacd2d0c99b0108b9879a3d0a3363cde4cf4bd37c90a033
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.11.32 {"installer":{"name":"uv","version":"0.11.32","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 history Release notifications | RSS feed

0.3.0

2 release files

0.2.0

2 release files

This release

0.1.1 This release

2 release files

0.1.0

2 release files

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