Skip to main content

Dreaming Electric Sheep

Dreaming Electric Sheep (des)

Dreaming Electric Sheep (des) is a Granian RSGI serving stack you pay a framework tax for startup-compiled msgspec binders, automated OpenAPI documentation from those types, and compile-time request pipeline inspection (des why).

Build PyPI Python Versions License


Installation

pip install "dreaming-electric-sheep[standard]"

[standard] includes granian (RSGI), typer, rich, msgspec, Jinja2, and uvloop (Linux/macOS).


Quickstart

1. Scaffold a project

Create a new REST API project (or use -t fullstack for HTMX + Jinja2 as default):

des new my_api -t api
cd my_api

Templates available:

  • -t api: REST API with msgspec.Struct validation and Scalar docs.
  • -t fullstack: Jinja2 templates, HTMX fragments, Tailwind CDN, and SSE streaming.
  • -t minimal: Single-file lightweight microservice.

2. Start the development server

des dev

The server starts on http://127.0.0.1:8000 with auto-reload enabled. Interactive API documentation is available at http://127.0.0.1:8000/docs.

3. Inspect the compiled route pipeline

Verify how routes, parameter decoders, and handlers are resolved at startup:

des why POST /items

Output:

Route:      POST /items
Handler:    app:create_item
Binders:
  • data: FromJSON[CreateItemInput] (pre-compiled msgspec decoder)
OpenAPI:    Documented in /openapi.json (schema: CreateItemInput)

Example

Here is a standard app.py combining schema validation, automated OpenAPI documentation, and clean route handling:

from des import Application, get, post
from msgspec import Struct

app = Application()

class Item(Struct):
    id: int
    name: str
    price: float

@get("/hello")
def hello():
    return {"message": "Hello from DES!"}

# Pre-compiled msgspec validation with structured 422 errors
@post("/api/items")
def create_item(data: Item):
    return {"status": "created", "item": data}

Features

  • Granian RSGI Transport: Native C/Rust socket communication bypassing ASGI message loop overhead.
  • Pre-Compiled Validation: msgspec.Struct decoders compiled at route registration time; produces standard FastAPI-compatible HTTP 422 errors.
  • Built-in HTMX Suite: Native helpers (fragment, hx_trigger, hx_redirect, hx_refresh) and sse_stream / ndjson_stream.
  • OpenAPI 3.0 Documentation: Automatic schema generation with Scalar UI, Swagger UI, and ReDoc support at /docs.
  • Developer Introspection: CLI tools (des why, des routes, des doctor, des check) to inspect the routing table and runtime health.

CLI Reference

Command Description
des new <name> -t <template> Scaffold a project (api, fullstack, or minimal)
des dev Start development server with auto-reload (Granian RSGI)
des run [app] --workers <n> Start production server with Granian RSGI
des routes Display the compiled radix routing table
des why <METHOD> <PATH> Explain route matching, parameter binders, and handler dispatch
des check Validate routes, binders, and configuration
des doctor Inspect C-extension status and interned memory tables

Benchmarks

Overhead measured against an in-memory fixture on localhost using oha (50 concurrent keep-alive connections, median of 5 runs of 5s each, CPython 3.14 on Linux x86_64, 1 worker process).

Framework Tax vs. Raw Server Ceilings (msgspec Encoder)

Measures framework overhead against raw server ceilings when all targets encode JSON per request using msgspec.json.encode with optimize_gc=False. The measured overhead represents the framework cost of route matching, request abstraction, and parameter binding over raw protocol sockets:

Framework / Layer Server / Runtime Plaintext (req/s) JSON (req/s) Mem get (req/s) Mem get ×20 (req/s) HTML fortunes (req/s) Mem update ×20 (req/s)
Granian (Raw RSGI) Rust RSGI (ceiling) 130,148 132,491 129,247 61,794 36,078 49,109
Dreaming Electric Sheep (RSGI) Granian (RSGI) 128,942 123,586 121,578 59,001 32,783 47,597
Granian (Raw ASGI) Rust ASGI (ceiling) 95,699 93,922 92,682 50,459 32,138 42,186
Dreaming Electric Sheep (ASGI) Granian (ASGI) 88,623 88,530 80,685 46,522 29,073 38,880
Uvicorn (Raw ASGI) Uvicorn ASGI (ceiling) 55,481 53,698 51,735 35,765 26,127 31,759

Default Stack Comparison (Stock Helpers Out-of-the-Box)

Measures out-of-the-box performance using each framework's standard serialization and response helpers:

Framework Server / Runtime Plaintext (req/s) JSON (req/s) Mem get (req/s) Mem get ×20 (req/s) HTML fortunes (req/s) Mem update ×20 (req/s)
Dreaming Electric Sheep (RSGI) Granian (RSGI) 121,069 122,107 118,083 56,176 32,432 45,328
Dreaming Electric Sheep (ASGI) Granian (ASGI) 86,350 86,744 79,035 40,206 25,639 39,075
Emmett Granian (RSGI/ASGI) 57,930 52,004 50,008 24,396 22,378 21,441
Sanic Sanic Core 46,014 42,729 40,802 24,766 21,946 22,896
Litestar Granian (ASGI) 33,523 32,140 30,722 20,600 16,695 18,930
Robyn Robyn Rust 30,885 28,311 27,791 18,921 17,786 17,727
FastAPI Granian (ASGI) 24,231 20,367 19,050 7,389 13,518 6,858
Django Granian (WSGI) 24,018 20,238 18,763 7,281 13,456 7,011
Flask Granian (WSGI) 23,794 20,186 18,644 7,271 13,274 6,986

See perf/compare/ and Why DES? for harness scripts and reproduction details.


Documentation


License & Attribution

Dreaming Electric Sheep is licensed under the MIT License.
Derived from BlackSheep (Copyright (c) Roberto Prevato and contributors). See NOTICE for details.

made with love by EduLoboM

Metadata

Release files for dreaming-electric-sheep 1.2.1

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

Source distribution (sdist)

Source distribution for dreaming-electric-sheep 1.2.1
File Size Uploaded
dreaming_electric_sheep-1.2.1.tar.gz 2.0 MB Details

Built distributions (wheels)

Table of built distributions (wheels) for dreaming-electric-sheep 1.2.1
File
dreaming_electric_sheep-1.2.1-cp314-cp314-win_arm64.whl CPython 3.14 CPython 3.14 Windows ARM64 Details
dreaming_electric_sheep-1.2.1-cp314-cp314-win_amd64.whl CPython 3.14 CPython 3.14 Windows x86-64 Details
dreaming_electric_sheep-1.2.1-cp314-cp314-musllinux_1_2_x86_64.whl CPython 3.14 CPython 3.14 Linux musl 1.2+ x86-64 Details
dreaming_electric_sheep-1.2.1-cp314-cp314-musllinux_1_2_aarch64.whl CPython 3.14 CPython 3.14 Linux musl 1.2+ ARM64 Details
dreaming_electric_sheep-1.2.1-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl CPython 3.14 CPython 3.14 Linux glibc 2.28+ x86-64, Linux glibc 2.17+ x86-64 Details
dreaming_electric_sheep-1.2.1-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl CPython 3.14 CPython 3.14 Linux glibc 2.28+ ARM64, Linux glibc 2.17+ ARM64 Details
dreaming_electric_sheep-1.2.1-cp314-cp314-macosx_10_15_universal2.whl CPython 3.14 CPython 3.14 macOS 10.15+ universal2 (ARM64, x86-64) Details
dreaming_electric_sheep-1.2.1-cp313-cp313-win_arm64.whl CPython 3.13 CPython 3.13 Windows ARM64 Details
dreaming_electric_sheep-1.2.1-cp313-cp313-win_amd64.whl CPython 3.13 CPython 3.13 Windows x86-64 Details
dreaming_electric_sheep-1.2.1-cp313-cp313-musllinux_1_2_x86_64.whl CPython 3.13 CPython 3.13 Linux musl 1.2+ x86-64 Details
dreaming_electric_sheep-1.2.1-cp313-cp313-musllinux_1_2_aarch64.whl CPython 3.13 CPython 3.13 Linux musl 1.2+ ARM64 Details
dreaming_electric_sheep-1.2.1-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl CPython 3.13 CPython 3.13 Linux glibc 2.17+ x86-64, Linux glibc 2.28+ x86-64 Details
dreaming_electric_sheep-1.2.1-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl CPython 3.13 CPython 3.13 Linux glibc 2.17+ ARM64, Linux glibc 2.28+ ARM64 Details
dreaming_electric_sheep-1.2.1-cp313-cp313-macosx_10_13_universal2.whl CPython 3.13 CPython 3.13 macOS 10.13+ universal2 (ARM64, x86-64) Details

Total release size: 83.6 MB

Release files / dreaming_electric_sheep-1.2.1.tar.gz

Download URL dreaming_electric_sheep-1.2.1.tar.gz
Size 2.0 MB
Tags Source
SHA-256 checksum
How to use checksums
71ff6a2a89d26386777ac28031b56bdb15a711d0396bdbb3d4d3c1875327e56c
BLAKE2b-256 checksum
How to use checksums
e02fc461dabd3a88ff2a71050a8a518f461f8dd77d6c1c03af988240ebf5a3a3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.15

Release files / dreaming_electric_sheep-1.2.1-cp314-cp314-win_arm64.whl

Download URL dreaming_electric_sheep-1.2.1-cp314-cp314-win_arm64.whl
Size 2.6 MB
Tags CPython 3.14 Windows ARM64
SHA-256 checksum
How to use checksums
e17cb0191ce0cd6765ca4cc855e6a5f29f0547b869c6add3a76c93cae8baafba
BLAKE2b-256 checksum
How to use checksums
1de9246f9df059ab85d03175345ae9fc5347c85a227cd36c19dd3e444b9441d0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.15

Release files / dreaming_electric_sheep-1.2.1-cp314-cp314-win_amd64.whl

Download URL dreaming_electric_sheep-1.2.1-cp314-cp314-win_amd64.whl
Size 2.7 MB
Tags CPython 3.14 Windows x86-64
SHA-256 checksum
How to use checksums
68a6679d964320936d16a755eeef70b81266e1f6124883dc729145c85c57b8fd
BLAKE2b-256 checksum
How to use checksums
07ba96ff903ddce9534109f009ff513fb3a2ad2ae3ddf3e48aa064c102ebf80a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.15

Release files / dreaming_electric_sheep-1.2.1-cp314-cp314-musllinux_1_2_x86_64.whl

Download URL dreaming_electric_sheep-1.2.1-cp314-cp314-musllinux_1_2_x86_64.whl
Size 7.9 MB
Tags CPython 3.14 Linux musl 1.2+ x86-64
SHA-256 checksum
How to use checksums
3fdef5985f19b971b0ddc1668a27416794326b49dd22e914faab075aceafc100
BLAKE2b-256 checksum
How to use checksums
d3cb3d4e4993d9fea0c1a8900fde44c83ecd7f4317f998e7c0ae156672d7130a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.15

Release files / dreaming_electric_sheep-1.2.1-cp314-cp314-musllinux_1_2_aarch64.whl

Download URL dreaming_electric_sheep-1.2.1-cp314-cp314-musllinux_1_2_aarch64.whl
Size 7.9 MB
Tags CPython 3.14 Linux musl 1.2+ ARM64
SHA-256 checksum
How to use checksums
394ea1fbbf579a2661ffa4721d7d6164c879051f3a68620bf01a5ef6747ea551
BLAKE2b-256 checksum
How to use checksums
aa75b6cc8d4e83072bfe9e2a8223e3335835c70118f8d47b800cdaa9248d2913
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.15

Release files / dreaming_electric_sheep-1.2.1-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl

Download URL dreaming_electric_sheep-1.2.1-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Size 8.1 MB
Tags CPython 3.14 Linux glibc 2.17+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
b20fdf8e53e184c8c299519b17f1d6c0d8d44e7e9efb48288e0b04cb6438ede2
BLAKE2b-256 checksum
How to use checksums
2b6636bd045c2f80181d3858ec22821d7999b9ac06bff7b8daf670ed2e322666
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.15

Release files / dreaming_electric_sheep-1.2.1-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl

Download URL dreaming_electric_sheep-1.2.1-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl
Size 8.0 MB
Tags CPython 3.14 Linux glibc 2.17+ ARM64 Linux glibc 2.28+ ARM64
SHA-256 checksum
How to use checksums
fd73fca862e54d1754e561636ba19dfca426fb9008d37f3d847faae9b7fab0d5
BLAKE2b-256 checksum
How to use checksums
1cb63e60a9989fc41e91f90e172f0525d40ae7e74a403498077560d0c4662361
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.15

Release files / dreaming_electric_sheep-1.2.1-cp314-cp314-macosx_10_15_universal2.whl

Download URL dreaming_electric_sheep-1.2.1-cp314-cp314-macosx_10_15_universal2.whl
Size 3.6 MB
Tags CPython 3.14 macOS 10.15+ universal2 (ARM64, x86-64)
SHA-256 checksum
How to use checksums
33c65d4c4984e25ca45a70dba3cb15090e7647348e6701eb9d7e5fd89362f991
BLAKE2b-256 checksum
How to use checksums
ba165b99b553223b6611e05d935126a78d71e4a876c522ebfbd94b94fb711d30
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.15

Release files / dreaming_electric_sheep-1.2.1-cp313-cp313-win_arm64.whl

Download URL dreaming_electric_sheep-1.2.1-cp313-cp313-win_arm64.whl
Size 2.6 MB
Tags CPython 3.13 Windows ARM64
SHA-256 checksum
How to use checksums
0699c5e20034511ebf837ec1ca1d7b420601011f6647f32b709e289b18f70b1d
BLAKE2b-256 checksum
How to use checksums
47a4d4b90bd7f2a64490831d4df56fb0ba2090474159199bb98e21e1e7d405a2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.15

Release files / dreaming_electric_sheep-1.2.1-cp313-cp313-win_amd64.whl

Download URL dreaming_electric_sheep-1.2.1-cp313-cp313-win_amd64.whl
Size 2.7 MB
Tags CPython 3.13 Windows x86-64
SHA-256 checksum
How to use checksums
73d354e89a04618f08d8391e2b3535974c56234e482ca5b1ba07d345047a6c32
BLAKE2b-256 checksum
How to use checksums
9e98f785241ce3495803c805964dc55ca00e36171d490a5fdf7ff26266c80e7a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.15

Release files / dreaming_electric_sheep-1.2.1-cp313-cp313-musllinux_1_2_x86_64.whl

Download URL dreaming_electric_sheep-1.2.1-cp313-cp313-musllinux_1_2_x86_64.whl
Size 7.9 MB
Tags CPython 3.13 Linux musl 1.2+ x86-64
SHA-256 checksum
How to use checksums
7ce7548d1c8a2a4a1ae8b05a5e4aaaedf5bfd35891084c7b1ef1f719dc1e95c2
BLAKE2b-256 checksum
How to use checksums
9eb90d09f55fa49408fb456b87ece584fc4be8db17aca9108b1e187ca6800542
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.15

Release files / dreaming_electric_sheep-1.2.1-cp313-cp313-musllinux_1_2_aarch64.whl

Download URL dreaming_electric_sheep-1.2.1-cp313-cp313-musllinux_1_2_aarch64.whl
Size 7.8 MB
Tags CPython 3.13 Linux musl 1.2+ ARM64
SHA-256 checksum
How to use checksums
853bacc37515f2382342dab6e679b685532b58c350f92b2e28eff1a6de2a7dcc
BLAKE2b-256 checksum
How to use checksums
68907c38589aee26b862aea828d6c9f7c8bb01c91329094a2f13daa05ecb1797
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.15

Release files / dreaming_electric_sheep-1.2.1-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl

Download URL dreaming_electric_sheep-1.2.1-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Size 8.1 MB
Tags CPython 3.13 Linux glibc 2.17+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
71ac40df62c191be0ae03af1a439027116adaf9c026d09e54700796e2e080fd5
BLAKE2b-256 checksum
How to use checksums
0eca8795043df79e84503b2078293021782ca503340c0164b31acf324a554bcb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.15

Release files / dreaming_electric_sheep-1.2.1-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl

Download URL dreaming_electric_sheep-1.2.1-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl
Size 8.0 MB
Tags CPython 3.13 Linux glibc 2.17+ ARM64 Linux glibc 2.28+ ARM64
SHA-256 checksum
How to use checksums
be33665b68f10f48bfff1ecd531eb0620aff92973db64b45cc31adfb10277785
BLAKE2b-256 checksum
How to use checksums
b791a22a82325d8e7133ea08d35f967dfd030d40e64bf4bac0c08cd2829e77ee
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.15

Release files / dreaming_electric_sheep-1.2.1-cp313-cp313-macosx_10_13_universal2.whl

Download URL dreaming_electric_sheep-1.2.1-cp313-cp313-macosx_10_13_universal2.whl
Size 3.6 MB
Tags CPython 3.13 macOS 10.13+ universal2 (ARM64, x86-64)
SHA-256 checksum
How to use checksums
4df42478072c3f89a1a3ae1e172ff745d9f868fa7842d39c948a4d38ab553b16
BLAKE2b-256 checksum
How to use checksums
7d974b74932aa017283e8bef5735adc098a916404972595675c42897a3615a6b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.15

Release history Release notifications | RSS feed

This release

1.2.1 This release

15 release files

1.1.2

15 release files

1.1.1

15 release files

1.1.0

15 release files

1.0.0

15 release files

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