Skip to main content

lightpath-agent

Python agent for Lightpath. It records which lines of your code each HTTP request ran and sends them to the Lightpath daemon, so they light up in your editor next to the frontend code that made the request.

  • Python 3.12+ (uses sys.monitoring). Standard library only.
  • Does nothing unless the process was started by lightpath dev.
  • Records only files inside your workspace, never site-packages.
  • Lines are reported in the order they first ran. Counts aren't available (each line reports once per request).

Use it

Flask:

from lightpath_agent import LightpathMiddleware
app.wsgi_app = LightpathMiddleware(app.wsgi_app)

Django (wsgi.py):

from lightpath_agent import LightpathMiddleware
application = LightpathMiddleware(get_wsgi_application())

FastAPI or Starlette:

from lightpath_agent import LightpathASGIMiddleware
app.add_middleware(LightpathASGIMiddleware)

Then run your server under Lightpath: lightpath dev -- uvicorn main:app --reload.

Limits

  • Recording is per interpreter. Requests that overlap (threads or async tasks) share hits and are marked as overlapped.
  • sys.monitoring.restart_events() is global, so other tools using sys.monitoring may see extra events while Lightpath runs.

Test

From the repo root: python -m unittest discover -s agents/python/tests -t agents/python

Metadata

Release files for lightpath-agent 0.0.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 lightpath-agent 0.0.1
File Size Uploaded Provenance Actions
lightpath_agent-0.0.1.tar.gz 9.5 kB Without provenance Details for lightpath_agent-0.0.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for lightpath-agent 0.0.1
File Interpreter ABI Platform Actions
lightpath_agent-0.0.1-py3-none-any.whl Python 3 none any Details for lightpath_agent-0.0.1-py3-none-any.whl

Total release size: 19.3 kB

Release files / lightpath_agent-0.0.1.tar.gz

Download URL lightpath_agent-0.0.1.tar.gz
Size 9.5 kB
Tags Source
SHA-256 checksum
How to use checksums
aeba96829656cdb2cfaa5cf1c3548d4c6923167ed0e8ca690c779156b2077958
BLAKE2b-256 checksum
How to use checksums
6bf34d278ae034e8d467840cb0e759ba14f4caca3c710bef3faa40715531683a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.5

Release files / lightpath_agent-0.0.1-py3-none-any.whl

Download URL lightpath_agent-0.0.1-py3-none-any.whl
Size 9.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0bef7e8c11b666a73cf2f7214d47430b22a10525cdeee08f0550a5558323dc6c
BLAKE2b-256 checksum
How to use checksums
1e5aede36c37298ae70f38a5c4a25870bde4e784edf32077e7d5b2dcdf061428
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.5

Security for lightpath-agent 0.0.1

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.

Release history Release notifications | RSS feed

This release

0.0.1 This release

2 release files No provenance

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