a python 3.6+ WSGI framework
Project description
pigwig
a pig wearing a wig is humor
a wig wearing a pig is heresy
pigwig is a python 3 WSGI framework
(blogwig is a sample app. don't put wigs on blogs)
#!/usr/bin/env python3
from pigwig import PigWig, Response
def root(request):
return Response('hello, world!')
routes = [
('GET', '/', root),
]
app = PigWig(routes)
if __name__ == '__main__':
app.main()
As I went to Bonner
I met a pig
Without a wig,
Upon my word and honor.
FACs (frequent, annoying comments)
- tornado-style class-based views are better
we think you're wrong (inheritance is a hammer and this problem is no nail), but it's easy enough to achieve:def routes(): views = [ ('/', RootHandler), ] handlers = [] for route, view in views: for verb in ['get', 'post']: if hasattr(view, verb): handlers.append((verb.upper(), route, cbv_handler(view, verb))) return handlers def cbv_handler(cbv, verb): def handler(request): return getattr(cbv(request), verb)() return handler class RootHandler: def __init__(self, request): self.request = request def get(self): return Response('hello')
- flask-style decorator-based routing is better
we think you're wrong (explicit is better than implicit), but it's easy enough to achieve:routes = [] def route(path, method='GET'): def wrapper(handler): routes.append((method, path, handler)) return handler return wrapper @route('/') def root(request): return Response('hello')
- django-style integration with an ORM is better
you're wrong
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 pigwig-0.8.4.tar.gz.
File metadata
- Download URL: pigwig-0.8.4.tar.gz
- Upload date:
- Size: 14.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d5bf59cc071f6ed7e32fd3464108ea9f44a8b1bee9251e7fc0468b4b57a70be7
|
|
| MD5 |
ae5068d7686e4dcf2d12eca13bac560c
|
|
| BLAKE2b-256 |
c9402187fe7eba286890856f6efc1bf0195787ecb709601191fd7261fb2a8e6b
|
Provenance
The following attestation bundles were made for pigwig-0.8.4.tar.gz:
Publisher:
pypi.yaml on raylu/pigwig
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pigwig-0.8.4.tar.gz -
Subject digest:
d5bf59cc071f6ed7e32fd3464108ea9f44a8b1bee9251e7fc0468b4b57a70be7 - Sigstore transparency entry: 582313797
- Sigstore integration time:
-
Permalink:
raylu/pigwig@812805cce2f5dd3de63cd3898f7b94bbee1e0e76 -
Branch / Tag:
refs/tags/v0.8.4 - Owner: https://github.com/raylu
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi.yaml@812805cce2f5dd3de63cd3898f7b94bbee1e0e76 -
Trigger Event:
release
-
Statement type:
File details
Details for the file pigwig-0.8.4-py3-none-any.whl.
File metadata
- Download URL: pigwig-0.8.4-py3-none-any.whl
- Upload date:
- Size: 16.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1231dedbee8f6626049d20589d61f27a50c869d1169a97569747ac29ba14fc7d
|
|
| MD5 |
53ac1a7f4905279739eae86f0b9776d8
|
|
| BLAKE2b-256 |
3f3d4e359c821b3b27185674fb70c02f42397195db142438e28c919740690a4f
|
Provenance
The following attestation bundles were made for pigwig-0.8.4-py3-none-any.whl:
Publisher:
pypi.yaml on raylu/pigwig
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pigwig-0.8.4-py3-none-any.whl -
Subject digest:
1231dedbee8f6626049d20589d61f27a50c869d1169a97569747ac29ba14fc7d - Sigstore transparency entry: 582313798
- Sigstore integration time:
-
Permalink:
raylu/pigwig@812805cce2f5dd3de63cd3898f7b94bbee1e0e76 -
Branch / Tag:
refs/tags/v0.8.4 - Owner: https://github.com/raylu
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi.yaml@812805cce2f5dd3de63cd3898f7b94bbee1e0e76 -
Trigger Event:
release
-
Statement type: