Skip to main content

A clean-room ASGI server with Uvicorn-compatible CLI and behavior mapping.

Project description

Palfrey

Palfrey

Palfrey is a clean-room, high-performance Python ASGI server with source-traceable parity mapping.

Test Suite Package version Supported Python versions


Documentation: https://palfrey.dev 📚

Source Code: https://github.com/dymmond/palfrey

The official supported version is always the latest released.


Palfrey is a clean-room ASGI server focused on three things:

  • behavior you can reason about
  • deployment controls you can operate safely
  • performance you can reproduce and verify

Protocol runtime modes include HTTP/1.1 backends plus opt-in HTTP/2 (--http h2) and HTTP/3 (--http h3) paths.

This documentation is written for both technical and non-technical readers.

  • Engineers can use the protocol details, option tables, and runbooks.
  • Product, support, and operations teams can use the plain-language summaries and checklists.

What Palfrey Does

At runtime, Palfrey sits between clients and your ASGI application.

  1. accepts TCP or UNIX socket connections
  2. parses protocol bytes into ASGI events
  3. calls your app with scope, receive, send
  4. writes responses back to clients
  5. manages process behavior (reload, workers, graceful shutdown)

Who Should Start Where

If you are new to ASGI

  1. Installation
  2. Quickstart
  3. Terms and Mental Models
  4. Server Behavior

If you operate production services

  1. Deployment
  2. Workers
  3. Observability
  4. Troubleshooting
  5. Release Process

First 60 Seconds

Create main.py:

async def app(scope, receive, send):
    """Return a plain-text greeting for HTTP requests."""
    if scope["type"] != "http":
        return

    body = b"Hello from Palfrey"
    await send(
        {
            "type": "http.response.start",
            "status": 200,
            "headers": [
                (b"content-type", b"text/plain; charset=utf-8"),
                (b"content-length", str(len(body)).encode("ascii")),
            ],
        }
    )
    await send({"type": "http.response.body", "body": body})

Run Palfrey:

palfrey main:app --host 127.0.0.1 --port 8000

Check it:

curl http://127.0.0.1:8000

Gunicorn + Palfrey worker:

gunicorn main:app -k palfrey.workers.PalfreyWorker -w 4 -b 0.0.0.0:8000

Documentation Structure

Getting Started

  • install, verify, and run your first app
  • move from a minimal app to real startup patterns

Concepts

  • what ASGI is, and how Palfrey applies it
  • how HTTP, WebSocket, and lifespan flows behave
  • how server internals affect user-visible outcomes

Reference

  • full CLI and config surface
  • protocol and logging behavior
  • env var model and common errors

Guides

  • migration, security hardening, production rollout
  • practical troubleshooting and FAQ

Operations

  • deployment shapes, workers, reload model
  • capacity planning, observability, benchmark method
  • platform-specific notes and release process

Plain-Language Summary

If your application is the business logic, Palfrey is the runtime control layer around it. A good runtime control layer gives teams:

  • predictable startup and shutdown
  • fewer surprises under traffic spikes
  • clearer incident response paths
  • safer, repeatable deployments

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

palfrey-0.1.0.tar.gz (182.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

palfrey-0.1.0-py3-none-any.whl (98.9 kB view details)

Uploaded Python 3

File details

Details for the file palfrey-0.1.0.tar.gz.

File metadata

  • Download URL: palfrey-0.1.0.tar.gz
  • Upload date:
  • Size: 182.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: Hatch/1.16.3 cpython/3.10.19 HTTPX/0.28.1

File hashes

Hashes for palfrey-0.1.0.tar.gz
Algorithm Hash digest
SHA256 bf743d5cb24a820aa21349311b1a56dc0f76cf287cca13e0804eed327b97470b
MD5 0fbf473fccdee32b89c970c514a02a0f
BLAKE2b-256 5c9e8d18d0197439cf679f9735c3d05be610b23854d64482d15047886cf6f197

See more details on using hashes here.

File details

Details for the file palfrey-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: palfrey-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 98.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: Hatch/1.16.3 cpython/3.10.19 HTTPX/0.28.1

File hashes

Hashes for palfrey-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ba23c06fe6214b5a15ac8832516963f30386629c134fe530a21019b79c5a9b85
MD5 cdff664d785df3397e279629776d5dc2
BLAKE2b-256 6cc6340f2708e8288b9ad656596a59fa27445b01fe1ab2bf031d823c980dc364

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page