Codeskop for Python
Errors, incoming requests and outgoing API calls from your Python backend, in Codeskop.
- Errors: unhandled exceptions (web requests, threads, Celery tasks, the main thread), plus
capture_exception(),capture_message()and alogginghandler. Stack traces are grouped by your own code, not library frames. - Incoming requests: every request your app handles, per route (
/orders/{pk}/), with status, latency and size. Shown on the Network page under Requests your servers receive. - Outgoing calls:
requestsandhttpxcalls to other APIs, with status, latency and failures. - Zero dependencies. Python 3.9+. Never blocks a request: events are sent in the background, compressed and retried.
Status: beta (0.1.1).
Install
pip install codeskop
Set up
import codeskop
codeskop.init(
api_key="cs_live_pk_…", # your project's public key (or set CODESKOP_API_KEY)
environment="production", # optional
release="1.4.2", # optional; auto-detected on Render, Heroku, Vercel, Railway, Cloud Run, GitHub Actions
)
Django
# settings.py
import codeskop
codeskop.init(api_key="cs_live_pk_…")
MIDDLEWARE = [
"codeskop.integrations.django.CodeskopMiddleware", # near the top
# ...
]
Flask
from flask import Flask
import codeskop
from codeskop.integrations.flask import CodeskopFlask
codeskop.init(api_key="cs_live_pk_…")
app = Flask(__name__)
CodeskopFlask(app) # or CodeskopFlask().init_app(app) in an app factory
FastAPI / Starlette
from fastapi import FastAPI
import codeskop
from codeskop.integrations.asgi import CodeskopMiddleware
codeskop.init(api_key="cs_live_pk_…")
app = FastAPI()
app.add_middleware(CodeskopMiddleware)
Celery
import codeskop
from codeskop.integrations import celery as codeskop_celery
codeskop.init(api_key="cs_live_pk_…")
codeskop_celery.install()
Errors by hand
try:
charge(order)
except PaymentError as exc:
codeskop.capture_exception(exc, tags={"provider": "stripe"})
codeskop.set_user(request.user.pk) # attach later events to a user
logging.getLogger().addHandler(codeskop.LoggingHandler()) # ERROR logs → Codeskop
Options
| Option | Default | |
|---|---|---|
api_key |
CODESKOP_API_KEY |
Public key (cs_live_pk_… / cs_test_pk_…). Secret keys are refused. |
endpoint |
https://api.codeskop.com |
CODESKOP_ENDPOINT |
environment |
production |
CODESKOP_ENVIRONMENT |
release |
auto | CODESKOP_RELEASE |
capture_requests |
True |
Incoming requests |
capture_outgoing |
True |
requests / httpx calls |
ignore_routes |
/health*, /healthz, /metrics, /favicon.ico |
Glob patterns not recorded |
ignore_exceptions |
() |
Exception class names never sent |
before_send |
None |
`fn(event) -> event |
send_user_id |
True |
Attach the signed-in user's ID |
debug |
False |
Log SDK activity |
Privacy
Never captured: request or response bodies, cookies, Authorization headers, query strings. Codeskop also redacts payload fields named like secrets (password, token, api_key, card number…) on the server.
Development
python -m venv .venv && .venv/bin/pip install -e ".[test]"
.venv/bin/pytest
The test suite runs against a local mock of the ingest API (tests/conftest.py). The contract is in the backend repo, docs/10-server-sdk-spec.md.
License
MIT
Metadata
Release files for codeskop 0.1.1
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 | |
|---|---|---|---|---|
| codeskop-0.1.1.tar.gz | 27.1 kB | With provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| codeskop-0.1.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 52.6 kB
Release files / codeskop-0.1.1.tar.gz
| Download URL | codeskop-0.1.1.tar.gz |
|---|---|
| Size | 27.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a7f2a97379bd1d799e19d61eca9e90856ad678ad3ac35ba4a0feeab6909a0118
|
|
BLAKE2b-256 checksum How to use checksums |
73e860117f40d3cbcbb26b9db210dc19f3c10c80c11e420eb59cedff21fe7ac9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Oct 6, 2026.
Transparency logRelease files / codeskop-0.1.1-py3-none-any.whl
| Download URL | codeskop-0.1.1-py3-none-any.whl |
|---|---|
| Size | 25.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
4febd4085b71051884f0123b5165f3b9dc863c0bff89b5b5f5712ff0b2cfc2f4
|
|
BLAKE2b-256 checksum How to use checksums |
4578a27ece7652f102d2d2c3ce941ec2190e361371df1e5c4501e165da929532
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Oct 6, 2026.
Transparency logSecurity for codeskop 0.1.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.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for codeskop-0.1.1.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 Oct 6, 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.