trailscope
The Trailscope SDK for Python 3.10+: logs every request with its route, timing, user, journey keys and (on errors) bodies and stack, plus Celery jobs and log lines, without blocking your request path. No dependencies beyond the standard library.
pip install trailscope
FastAPI / Starlette
import trailscope
from trailscope.asgi import TrailscopeMiddleware
trailscope.init(service="orders-api") # reads TRAILSCOPE_ENDPOINT and TRAILSCOPE_INGEST_KEY
app = FastAPI()
app.add_middleware(TrailscopeMiddleware) # add it last, so it runs first
Django
MIDDLEWARE = ["trailscope.django.TrailscopeMiddleware", ...] # first
TRAILSCOPE = {"service": "orders-api"}
Celery and logging
from trailscope.celery import instrument
instrument() # in the web process and the worker, after trailscope.init()
logging.getLogger().addHandler(trailscope.TrailscopeHandler())
In request code: trailscope.set_user(user_id), trailscope.set_correlation("order_id", order_id).
Full documentation: docs/sdk-python.md.
License
Apache-2.0
Metadata
Release files for trailscope 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| trailscope-0.1.0.tar.gz | 22.9 kB | With provenance | Details for trailscope-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| trailscope-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for trailscope-0.1.0-py3-none-any.whl |
Total release size: 48.3 kB
Release files / trailscope-0.1.0.tar.gz
| Download URL | trailscope-0.1.0.tar.gz |
|---|---|
| Size | 22.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
55481b3e40537df76777cac821f4d065c82df0954d1acbf9781e835e3401ec79
|
|
BLAKE2b-256 checksum How to use checksums |
06b7e9371b3941a0a2655b34cfeeddb96ac7a1f9656caf19081936a238e11f38
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 9, 2026.
Transparency logRelease files / trailscope-0.1.0-py3-none-any.whl
| Download URL | trailscope-0.1.0-py3-none-any.whl |
|---|---|
| Size | 25.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
1c3fb85144cd2526600d70084b012a10d0ea7afeb1dcea8830a6288aa2dfcbf8
|
|
BLAKE2b-256 checksum How to use checksums |
d99e298b6bb27dbe5b5c654cbffd74f01c69eb547665b8e0b8664e2b27a03296
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 9, 2026.
Transparency logSecurity for trailscope 0.1.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.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for trailscope-0.1.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 9, 2026.
Transparency logA 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.