Skip to main content

without-web

An opinionated HTTP and WebSocket router for without-asgi. without-asgi deliberately ships no router, only the unopinionated boundary and composition tools. without-web is the opinionated layer on top: t-string patterns with typed parameters, typed request extraction, 405-vs-404, mounting, scoped middleware, exception handlers, reverse routing (url_for), and OpenAPI.

It snaps onto the boundary through nothing but the existing HttpRouter type: Router.dispatch is an HttpRouter[T], so make_asgi_app(http=router.dispatch) just works, and bring-your-own (or no router at all) stays first-class.

import json

from without_asgi import Response, make_asgi_app
from without_web import INT, Router, get, path_param

uid = path_param("id", INT)  # one token: a pattern segment AND a typed read


@get(t"/users/{uid}", uid)  # t-string pattern; `@get` returns a Route value
async def show_user(state, user_id: int):  # user_id is an int, no `assert isinstance`
    body = json.dumps({"id": user_id}).encode()
    return Response(status=200, headers=((b"content-type", b"application/json"),), body=body)


router = Router(routes=(show_user,), fallback=not_found)
app = make_asgi_app(lifespan, http=router.dispatch)

Matching is a pure walk of an immutable trie, so precedence, 405-vs-404, and mounting fall out of the structure. Converters and extractors parse, they don't validate: a path param arrives already typed, and OpenAPI is a merge of the self-descriptions each layer recovers from structure rather than a blob declared by hand. Encoding stays the app's choice, so the router ships no json_response-style helper.

See the without-web guide (with the API reference) for the full surface: patterns, extractors, streaming input, mounting, middleware, exception handlers, reverse routing, OpenAPI, and WebSocket routing.

Metadata

Release files for without-web 0.0.9

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

Source distribution (sdist)

Source distribution for without-web 0.0.9
File Size Uploaded
without_web-0.0.9.tar.gz 31.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for without-web 0.0.9
File Interpreter ABI Platform
without_web-0.0.9-py3-none-any.whl Python 3 none any Details

Total release size: 68.6 kB

Release files / without_web-0.0.9.tar.gz

Download URL without_web-0.0.9.tar.gz
Size 31.4 kB
Tags Source
SHA-256 checksum
How to use checksums
d60e91d73cdc49017e49497ebccd28acf8463bf28958c80f13ecf0bcb59b6a21
BLAKE2b-256 checksum
How to use checksums
b7b5143979ffbd32398a807346c7eb5bea4278f36db49a6c9018283b1f683526
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.14 {"installer":{"name":"uv","version":"0.12.14","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / without_web-0.0.9-py3-none-any.whl

Download URL without_web-0.0.9-py3-none-any.whl
Size 37.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1bf6c096e53542245f970abba293e5b65687d5371c007a98093c834957fa5643
BLAKE2b-256 checksum
How to use checksums
f5e3fac36545a84bf9f202fedadc5fc6011d2ed83cbb8f0a019b44d0606efdaa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.14 {"installer":{"name":"uv","version":"0.12.14","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release history Release notifications | RSS feed

This release

0.0.9 This release

2 release files

0.0.8

2 release files

0.0.7

2 release files

0.0.6

2 release files

0.0.5

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

2 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