Decorators for WSGI without start_response and write
Project description
wsgistraw (WSGI without STart_Response And Write) is a tiny Python library that simplifies coding WSGI applications and middleware by removing start_response and write from signatures of functions. This leads to a signature like:
def app(environ):
return "200 OK", [("Content-Type", "text/plain")], ["Hello World!"]
That is, return a three-tuple of (status, headers, response).
start_response and write are very annoying in WSGI middleware. wsgistraw makes your middleware code cleaner. This is an example of a “lowercase” middleware factory:
@wsgistraw.mid_factory
def lowercase(app):
def mid(environ):
status, headers, response = app(environ)
return status, headers, (s.lower() for s in response)
return mid
What’s New
A bugfix release. Fixed a bug in app_proxy with extending an iterable with the results of write().
See Also
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file wsgistraw-0.1.2.zip.
File metadata
- Download URL: wsgistraw-0.1.2.zip
- Upload date:
- Size: 16.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fb06c32aa458939f8a3dcda6482f6d3abde7b2dee63a862e6c8ff978daf7260a
|
|
| MD5 |
70f49051741377d2ae4a3a6f7099812a
|
|
| BLAKE2b-256 |
a8267bf4c62384aacedbd1ace3d59cb2e8b88aa01b42f138c599495068a68224
|
File details
Details for the file wsgistraw-0.1.2-py2.4.egg.
File metadata
- Download URL: wsgistraw-0.1.2-py2.4.egg
- Upload date:
- Size: 5.5 kB
- Tags: Egg
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6b564e88d753a995bbd9f02fc5d93046c7878a49d67dc398f10de06e57d1446f
|
|
| MD5 |
3b7e6cd8592da5ef59da0fa9bfab2f42
|
|
| BLAKE2b-256 |
4f42daa3065782ed1aa5a1282c11196cbca9c39f7d187d7ab20fbdc0c701ad42
|