Web Services Made Easy¶
Introduction¶
Web Services Made Easy (WSME) simplifies the writing of REST web services by providing simple yet powerful typing, removing the need to directly manipulate the request and the response objects.
WSME can work standalone or on top of your favorite Python web (micro)framework, so you can use both your preferred way of routing your REST requests and most of the features of WSME that rely on the typing system like:
Alternate protocols, including those supporting batch-calls
Easy documentation through a Sphinx extension
WSME is originally a rewrite of TGWebServices with a focus on extensibility, framework-independence and better type handling.
How Easy?¶
Here is a standalone WSGI example:
from wsme import WSRoot, expose
class MyService(WSRoot):
@expose(unicode, unicode) # First parameter is the return type,
# then the function argument types
def hello(self, who=u'World'):
return u"Hello {0} !".format(who)
ws = MyService(protocols=['restjson', 'restxml'])
application = ws.wsgiapp()
With this published at the /ws
path of your application, you can access your
hello function in various protocols:
URL |
Returns |
---|---|
|
|
|
|
Main features¶
Very simple API.
Supports user-defined simple and complex types.
Multi-protocol : REST+JSON, REST+XML and more possible.
Extensible : easy to add more protocols or more base types.
Framework independence : adapters are provided to easily integrate your API in any web framework, for example an WSGI container, Pecan, Flask, …
Very few runtime dependencies: webob, simplegeneric.
Integration in Sphinx for making clean documentation with
wsmeext.sphinxext
.
Install¶
pip install WSME
Changes¶
Read the Changelog
Getting Help¶
Read the WSME Documentation.
Questions about WSME should go to the python-wsme mailinglist.
Contribute¶
Documentation: http://packages.python.org/WSME/
Code review: https://review.openstack.org/#/q/project:openstack/wsme,n,z
Contents¶
- Getting Started
- API
- Types
- Functions
- Protocols
- Integrating with a Framework
- Document your API
- TODO
- Changes
- 1.0.0 (future)
- 0.9.2 (2017-02-14)
- 0.9.1 (2017-01-04)
- 0.9.0 (2017-01-04)
- 0.8.0 (2015-08-25)
- 0.7.0 (2015-05-13)
- 0.6.4 (2014-11-20)
- 0.6.3 (2014-11-19)
- 0.6.2 (2014-11-18)
- 0.6.1 (2014-05-02)
- 0.6 (2014-02-06)
- 0.5b6 (2013-10-16)
- 0.5b5 (2013-09-16)
- 0.5b4 (2013-09-11)
- 0.5b3 (2013-09-04)
- 0.5b2 (2013-04-18)
- 0.5b1 (2013-01-30)
- 0.4 (2012-10-15)
- 0.4b1 (2012-09-14)
- 0.3 (2012-04-20)
- 0.3b2 (2012-03-29)
- 0.3b1 (2012-01-19)
- 0.2.0 (2011-10-29)
- 0.1.1 (2011-10-20)
- 0.1.0 (2011-10-14)
- 0.1.0a4 (2011-10-12)
- 0.1.0a3 (2011-10-11)
- 0.1.0a2 (2011-10-07)
- 0.1.0a1 (2011-10-04)