Skip to main content

Cheap observability for Python processes

Project description

plotsrv icon      plotsrv


eCI codecov PyPI - Version PyPI - Python Version

Lightweight observability for Python processes with instant UI

Live demo: https://demo.plotsrv.com
See plotsrv render plots, tables, JSON, and HTML from real sensor data.

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. Fire up the server with a single command, and plotsrv takes care of 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

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

Get going

  1. Install plotsrv
pip install plotsrv

Or

uv add plotsrv
  1. Start the server

Provide a script, module or entire package:

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:

import plotsrv as ps

@ps.view(label="sales", section="insights")
def sales_plot():
    return fig

@ps.view(label="latest", section="insights")
def latest_results():
    return df

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

You can also publish views directly instead of using decorators:

import plotsrv as ps

ps.publish_view({"status": "ok", "rows": 123}, label="summary")

Watching files on disk

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

For quick use:

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

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.2.0.tar.gz (1.0 MB view details)

Uploaded Source

Built Distribution

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

plotsrv-0.2.0-py3-none-any.whl (748.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: plotsrv-0.2.0.tar.gz
  • Upload date:
  • Size: 1.0 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.13

File hashes

Hashes for plotsrv-0.2.0.tar.gz
Algorithm Hash digest
SHA256 4fa962d8b605e8fbb7632eae0bca94f8323d1e75f7ffad97430169e5f01574ba
MD5 45844e98c3a296d8769b0d1f18bc27c7
BLAKE2b-256 ab0aadd242151ee1af1447bb4e40814c3a19531e0de65493e19e949d52d6c618

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for plotsrv-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 59f07fa5c88db9d0ec0e71ac479a19347b3f43bc9946c7ce23a0ad55538ccc6c
MD5 7e408af672a0a6dde42de0d0aead5cbe
BLAKE2b-256 228aa32cec989df99917ca2f82563dfb20408e529d6aefbe59307ff1aaafeb4c

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