Skip to main content

Cheap observability for Python processes

Project description

plotsrv

plotsrv


CI codecov PyPI - Version PyPI - Python Version

Cheap observability for Python processes, with a browser UI and almost no setup.

plotsrv is a lightweight Python server for exposing live Python objects and on-disk files in a single browser UI. It gives you quick visibility into pipelines, experiments, batch jobs, and long-running processes without needing a full observability stack.

Add a decorator to functions you want to expose, or publish artifacts directly from your code. plotsrv handles discovery, view registration, and object-specific rendering automatically.

Key features:

  • Browser UI built on FastAPI for viewing live outputs in one place
  • Automatic rendering for common Python outputs: plots, tables, JSON, text, HTML, images, code, and tracebacks
  • Minimal setup: decorate functions and launch the server
  • AST-based discovery of decorated views, so the UI can pre-populate navigation on startup
  • Optional on-disk snapshots, with historical browsing and configurable retention
  • Freshness tracking, so you can quickly see when a process is delayed or stale
  • Configuration via plotsrv.yaml, including UI settings
  • CLI-first workflow, with Python entry points available where needed

What it can render

  • plots
  • tables
  • JSON and dictionaries
  • markdown and HTML
  • images
  • plain text and code
  • tracebacks

It can also watch files on disk and expose them in the same UI.

Get going

  1. Start the server
plotsrv run your_module.py --host 127.0.0.1 --port 8000

You can also start the server from Python if needed.

  1. Expose views from your code

The main pattern is to decorate functions whose output you want to expose:

from plotsrv import plotsrv

@plotsrv(label="sales", section="insights")
def sales_plot():
    return fig

@plotsrv(label="latest", section="insights")
def latest_results():
    return df

plotsrv inspects the returned object and chooses an appropriate renderer automatically.

You can also publish artifacts directly instead of using decorators:

from plotsrv import publish_artifact

publish_artifact({"status": "ok", "rows": 123}, label="summary")

Watching files on disk

plotsrv can also expose files directly from disk, which is useful for logs, reports, HTML files, JSON outputs, CSVs, and generated artifacts.

plotsrv run src.etl --host 127.0.0.1 --port 8000 \
  --watch /var/log/etl_log.txt --watch-label etl-log --watch-section log-files --watch-tail --no-truncate

Status

plotsrv is currently pre-0.1.0 and still evolving, but is already usable for real workflows.

License

plotsrv is licensed under the Apache License 2.0.\

See the LICENSE file for full details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

plotsrv-0.0.6.tar.gz (609.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

plotsrv-0.0.6-py3-none-any.whl (493.0 kB view details)

Uploaded Python 3

File details

Details for the file plotsrv-0.0.6.tar.gz.

File metadata

  • Download URL: plotsrv-0.0.6.tar.gz
  • Upload date:
  • Size: 609.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.10

File hashes

Hashes for plotsrv-0.0.6.tar.gz
Algorithm Hash digest
SHA256 a9595804eebe069b9254846f4864b4e707726eb4c789bac8e3f461a24a94aca0
MD5 615182c2eb178554740acadf54d88f1b
BLAKE2b-256 fc6f27aa43f5bc892992e6d400aea7df4909203a1099521cf1f3c87dea9a8911

See more details on using hashes here.

File details

Details for the file plotsrv-0.0.6-py3-none-any.whl.

File metadata

  • Download URL: plotsrv-0.0.6-py3-none-any.whl
  • Upload date:
  • Size: 493.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.10

File hashes

Hashes for plotsrv-0.0.6-py3-none-any.whl
Algorithm Hash digest
SHA256 da4e3a810dad6dd771d29e6096f5e74a043f7e1c2b8604869fa5bf25b420933f
MD5 b7b9ad10f90a3e3b78d40401fd6d1cd3
BLAKE2b-256 f9d3c8edd15b7c9176f5ca835cc4b90fe4098b37a1b8283a2cb7b253373ae09a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page