wsgiven
wsgiven is a small WSGI toolkit: route PATH_INFO with regular expressions, stack middlewares, and optionally wrap handlers with shared utilities (for example JSON responses or centralized error handling).
The package has no runtime dependencies beyond the Python standard library.
Requirements
- Python 3.10 or newer
Install
From a clone of this repository:
uv pip install .
Or with pip:
pip install .
Quick example
from wsgiven import Application
from wsgiven.middlewares import handle_error
from wsgiven.utils.wsgi import jsonify
def hello(application, environ, start_fn):
status = "200 OK"
body, headers = jsonify({"message": "hello"})
return status, body, headers
app = Application(
routes={r"^/$": hello},
middlewares=[handle_error],
)
Use it with any WSGI server (for example Gunicorn, uWSGI, or wsgiref.simple_server for local runs).
Development
Clone the repository, then install dev dependencies (uses the committed uv.lock) and run checks:
uv sync --locked
uv run ruff check wsgiven tests
uv run ruff format --check wsgiven tests
uv run pytest
To refresh dev dependencies and regenerate the lockfile:
uv lock --upgrade
To apply Ruff formatting (instead of only checking):
uv run ruff format wsgiven tests
Contributing
Issues and pull requests (including from forks) are welcome. Please run uv run ruff check, uv run ruff format --check, and uv run pytest before submitting a change.
Releases: PyPI uploads are done only via this repository’s release workflow when a maintainer pushes a version tag. Forks and outside contributors cannot trigger that path for this repo. If you grant write access to collaborators, restrict the GitHub pypi environment with required reviewers so only you (or chosen maintainers) can approve a publish run.
License
MIT — see LICENSE.
Metadata
Release files for wsgiven 1.1.0
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 | |
|---|---|---|---|---|
| wsgiven-1.1.0.tar.gz | 4.9 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| wsgiven-1.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 9.9 kB
Release files / wsgiven-1.1.0.tar.gz
| Download URL | wsgiven-1.1.0.tar.gz |
|---|---|
| Size | 4.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
37db61acb62c08c6e12ca427661cfd3fce85f83022b3bb2924914d27a2cd4c69
|
|
BLAKE2b-256 checksum How to use checksums |
22a669b5a65f5eab379541bc58df69793ae6b3b98cf8d36e667bb7ac6c318271
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.11.14 {"installer":{"name":"uv","version":"0.11.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 / wsgiven-1.1.0-py3-none-any.whl
| Download URL | wsgiven-1.1.0-py3-none-any.whl |
|---|---|
| Size | 5.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c1db8a32e4f00e8ff54ba47af6426b0bad4b9b53e86dda2b1d8242099cb3d209
|
|
BLAKE2b-256 checksum How to use checksums |
abeb85b8c097574c8d906a6130defe8713e175f52b08b07f81665a4c847747ac
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.11.14 {"installer":{"name":"uv","version":"0.11.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}
|
Security for wsgiven 1.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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
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.