Source

wsgiserialize /

Filename Size Date modified Message
wsgiserialize
215 B
559 B
3.2 KB
1.3 KB
24.1 KB

Simple object serialization middleware for WSGI. Object serialization formats include:

  • XML-RPC
  • JSON
  • YaML
  • marshal
  • pickle
  • cPickle

Sample usage:

from wsgiserializer.jsonize import jsonize

@jsonize
def simple_app(environ, start_response):
    start_response('200 OK', [('Content-type','text/plain')])
    return {'test':'Hello world!\n'}

if __name__ == '__main__':
    from wsgiref.simple_server import make_server
    http = make_server('', 8080, simple_app)
    http.serve_forever()