Skip to main content

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)

  1. 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')
    
  2. 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')
    
  3. django-style integration with an ORM is better
    you're wrong

coverage status

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)

Source distribution for pigwig 0.8.4
File Size Uploaded
pigwig-0.8.4.tar.gz 14.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pigwig 0.8.4
File Interpreter ABI Platform
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 log

Release 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

Release history Release notifications | RSS feed

This release

0.8.4 This release

2 release files

0.8.3

2 release files

0.8.2

1 release file

0.8.1

2 release files

0.8.0

2 release files

0.7.0

2 release files

0.6.0

2 release files

0.5.0

2 release files

0.4.0

2 release files

0.3.0

2 release files

0.2.0

1 release file

0.1.0

1 release file

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