Skip to main content

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 a logging handler. 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: requests and httpx calls 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.0).

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.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for codeskop 0.1.0
File Size Uploaded Provenance
codeskop-0.1.0.tar.gz 27.0 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for codeskop 0.1.0
File Interpreter ABI Platform
codeskop-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 52.6 kB

Release files / codeskop-0.1.0.tar.gz

Download URL codeskop-0.1.0.tar.gz
Size 27.0 kB
Tags Source
SHA-256 checksum
How to use checksums
990239fc6536ad9b2288193efeec5c4b0f12dea06733bfc6a785272f5988e7f1
BLAKE2b-256 checksum
How to use checksums
7ceba2f305ab7220b11c5ab4fe38df2cbc9550a8881451e7281199915d790cdb
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 5, 2026.

Transparency log

Release files / codeskop-0.1.0-py3-none-any.whl

Download URL codeskop-0.1.0-py3-none-any.whl
Size 25.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3e15fc3e755fad7c9a07423bc2f72d914e110c45f76e4b239f73794e7c266eab
BLAKE2b-256 checksum
How to use checksums
edcfb36df5d10a6729a86c000c3fad765eec5e7ae4cd93541919d141a0d4479c
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 5, 2026.

Transparency log

Security for codeskop 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

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for codeskop-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 Oct 5, 2026.

Transparency log

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.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files Full 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