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
Release files for pigwig 0.8.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| pigwig-0.8.4.tar.gz | 14.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pigwig-0.8.4-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 30.3 kB
Release files / pigwig-0.8.4.tar.gz
| Download URL | pigwig-0.8.4.tar.gz |
|---|---|
| Size | 14.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d5bf59cc071f6ed7e32fd3464108ea9f44a8b1bee9251e7fc0468b4b57a70be7
|
|
BLAKE2b-256 checksum How to use checksums |
c9402187fe7eba286890856f6efc1bf0195787ecb709601191fd7261fb2a8e6b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 3, 2025.
Transparency logRelease files / pigwig-0.8.4-py3-none-any.whl
| Download URL | pigwig-0.8.4-py3-none-any.whl |
|---|---|
| Size | 16.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
1231dedbee8f6626049d20589d61f27a50c869d1169a97569747ac29ba14fc7d
|
|
BLAKE2b-256 checksum How to use checksums |
3f3d4e359c821b3b27185674fb70c02f42397195db142438e28c919740690a4f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 3, 2025.
Transparency log