This release is a pre-release and may not be stable for production use.
redline-core
The framework-agnostic engine behind Redline, a self-hosted request profiler and backend analyzer and load tester for Django, FastAPI, Flask and Litestar.
redline-core holds everything that does not depend on a web framework:
- the trace/span data model and a
contextvarsrecorder that follows async tasks and explicitly propagated thread contexts; ordinary new threads need explicit context propagation; - SQL fingerprinting, project-only callsite capture and secret redaction;
- detectors for N+1 queries, duplicate queries, slow queries and query budgets, plus
event-loop blocking, long transactions, huge and unbounded results,
len(qs)vs.exists(), slow serializers and slow, duplicated or retried external calls; - an on-demand
EXPLAINrunner with plan analysis for PostgreSQL, MySQL, SQLite and SQL Server (with documented driver limits); - an optional
pyinstrumentflamegraph profiler (redline-core[profile]); - a separate SQLite store with a background writer, retention, hourly rollups and release history;
- a load tester (
redline load, extraload) with an open-model scheduler, knee detection and per-step bottlenecks; - a refactor check (
redline check, extraload): record a baseline of read-only requests, compare a new version, per-endpoint verdicts on responses and speed, JUnit and Markdown output; - optional integrations in
redline_core.contrib(SQLAlchemy, httpx, requests, redis, asyncpg, psycopg, Marshmallow, Strawberry, Graphene); - the access policy and layered configuration shared by every adapter;
- the framework-neutral JSON API and the prebuilt web UI.
It has no runtime dependencies.
You probably want an adapter
Install the package for your framework; it pulls in redline-core for you:
Published adapters are available on PyPI and pull in the matching core automatically.
Choose django-redline, fastapi-redline, flask-redline or litestar-redline:
pip install --pre django-redline
This checkout describes the next v0.4 release. PyPI behavior depends on the installed version; unreleased changes require a local source installation.
Extras on the core requirement: profile (flamegraphs), load (the load tester), and
httpx, requests, redis, asyncpg, psycopg, strawberry, graphene. Documentation:
https://pythondeveloper6.github.io/redline/.
Timing your own code
import redline_core
@redline_core.span("pricing.compute")
def compute_price(order): ...
async def handler():
async with redline_core.span("fetch-rates", kind="custom", provider="ecb"):
...
span() does nothing (and costs almost nothing) outside a recorded request.
v0.4 real-world workflows
The next release adds:
- Handled SQL failures with vendor/SQLSTATE/native-code classification, raw rowcounts, failed-attempt counts and stable issue groups, even when the application returns HTTP 200.
- SQL Server estimated plans, guarded actual-plan collection and catalog candidates; explicit engine ownership, optional all-engine observation and observed session-state evidence.
- Offline
redline check-sqlfor supported raw-SQL Python shapes, JSON/JUnit reports, baselines, explicit compile checks and schema snapshots. Static checks are conservative. - Generic background jobs, stages, row outcomes, retries and optional Celery signals; a Jobs page and commit-before-failure evidence for investigating partial job completion.
- SQL value policies, privacy profiles, route rules, request/user correlation and redaction preview.
- Bounded capture, failure-safe observation, storage auditing, read-only worker-store browsing, and explicit sanitized OTLP summary export.
Use these to investigate a caught database error, a migration that broke raw SQL, a worker that committed before failing, an N+1 endpoint, or a performance refactor whose responses must remain equivalent. The UI exposes SQL evidence, jobs, offline SQL checks and privacy preview alongside the existing timelines, plans, profiles and refactor reports.
For production choose the record-and-inspect preset, private storage and authenticated access. Replay, load/refactor runs, source analysis and database plan execution are disabled by default there. Live MySQL/SQL Server drivers, broker/prefork behavior and the intended filesystem/deployment must be qualified before rollout; fixture tests do not establish compatibility with every codebase.
See the detailed workflow guide, production guide and feature catalog.
Please test Redline on a real development or staging project and open an issue for bugs or feature requests. Include framework/database/driver versions and a small sanitized reproduction. Never post credentials or private recordings; follow the security policy for vulnerabilities.
License
MIT
Metadata
Release files for redline-core 0.5.0b2
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 |
|---|---|---|---|---|
| redline_core-0.5.0b2.tar.gz | 991.1 kB | With provenance | Details for redline_core-0.5.0b2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| redline_core-0.5.0b2-py3-none-any.whl | Python 3 | none | any | Details for redline_core-0.5.0b2-py3-none-any.whl |
Total release size: 1.8 MB
Release files / redline_core-0.5.0b2.tar.gz
| Download URL | redline_core-0.5.0b2.tar.gz |
|---|---|
| Size | 991.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9ee9696d1d9f016d8ed30540dc499b0aa61c4c4ed390f10f28e916c82e9f15e9
|
|
BLAKE2b-256 checksum How to use checksums |
d8db7e79f715a86a214df9a06cdc1f682d2920ac71269846051c8245bdf62d5e
|
| 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 26, 2026.
Transparency logRelease files / redline_core-0.5.0b2-py3-none-any.whl
| Download URL | redline_core-0.5.0b2-py3-none-any.whl |
|---|---|
| Size | 823.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
429d58bf770724f3885d23f62b1c8a42489eee90f2f45f08cc4d4e2a8fec19b3
|
|
BLAKE2b-256 checksum How to use checksums |
1b9bbab2745229d7e28c60b50b15b129937f9c96539fca098373fa646e1031e7
|
| 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 26, 2026.
Transparency logSecurity for redline-core 0.5.0b2
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 redline_core-0.5.0b2.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 26, 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.