This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
Project Description

You could call it Webob augmented itty . It borrows it’s form but allow for the use of a passed in Request or Response object. By default, it uses the Request and Response from WebOb, as well as WebOb’s.

Why?

We were working with itty and hit our head a few times. We really liked the way it worked though and thought we might fit it with our favorite request and response objects. 106 lines later, wee was born as the dispatcher for a wsgi app.

Basic Usage

Here is a super simple pony app to show the basics of wee. Pretty much the same as itty except we use full regex strings:

import wee
from wsgiref.simple_server import make_server

@wee.get(r'^/$')
def ponytime(request):
    return "It's Pony time!"


@wee.post(r'^/$'):
def make_pony(request):
    ... make a pony ...


@wee.put('^/(?P<pony_name>\w+)$'):
def add_unicorn_horn(request, pony_name=None):
    ... change a pony ...


@wee.delete('^/(?P<pony_name>\w+)$'):
def kill_a_pony(request, pony_name):
    ... delete a pony ...

srv = make_server(host, port, wee.make_app())
srv.serve_forever()

Using a prefix

Sometimes you want to hang a wee app on an existing app tree:

import wee

@wee.get('^/$')
def logical_root(request):
    return "I'm an index"

registry = wee.PrefixRegistry(prefix='/my/crazy/existing/dispatch/tree')

wee.make_app(registry=prefix)

Experimental REST Container support

There is some rough support for creating simple CRUD containers like so:

import wee

@wee.rest("^/candymountain")
class UnicornStable(wee.Resource):
    subtype = 'unicorn_id'
    def get(self):
        ... your list of unicorns ...

    def post(self):
        name = self.request.POST['unicorn-name']
        ... make a unicorn ...

    def getitem(self, unicorn_id):
        ... serve a unicorn ...

    def put(self, unicorn_id):
        ... change a unicorn ...

    def delete(self, unicorn_id):
        ... kill a unicorn ...

The rest verb generates a series of regexes to dispatch upon for the appropriate verbs with a special care to separate ‘get’ (/) and ‘getitem’ (/some_id).

Other Differences from itty

The only other main difference is that dispatch is scoped by the module that defines the handler. This means multiple wee apps can run in the same process without clobbering each other.

We don’t give you are run command either, nor any adapters for popular frameworks. Maybe later.

Coverage

coverage.py says 100% currently, but we could have more unittests vs. stack tests.

Wait I’m Confused …

“When do I use itty and when do I use wee?”

You probably shouldn’t use either. This is an experiment, so seems to be itty.

If you are brave though, use wee when you want to do some itty or sinatra like, but are using Webob. Use itty when you want some totally contained in itself w/ no dependencies that requires little configuration that you want to run as quickly as possible.

Credits

Daniel Lindsley – Author of itty

Matt George and Whit Morriss – Ax work on Wee

Release History

Release History

0.1.1

This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.1

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

TODO: Brief introduction on what you do with files - including link to relevant help section.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
wee-0.1.1.tar.gz (6.9 kB) Copy SHA256 Checksum SHA256 Source Feb 26, 2010

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS HPE HPE Development Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting