WSME
Simplify the writing of REST APIs, and extend them with additional protocols.
What it is and what it does
WSME is a REST API framework that removes boilerplate by letting you define web service methods with Python type annotations instead of manually parsing requests and serializing responses. You decorate functions with `@expose()` to declare parameter and return types, then WSME automatically handles protocol conversion, validation, and documentation. It works standalone as a WSGI application or integrates into existing frameworks like Flask or Pecan, supporting multiple protocols (REST+JSON, REST+XML) and generating Sphinx documentation from your type definitions.
The package is lightweight—just four runtime dependencies—and framework-agnostic, so you can use it with your preferred routing layer while delegating type handling and serialization to WSME. It's particularly useful when you want clean, self-documenting APIs without writing separate request/response parsing code.
Use it for:
- Build a REST API with automatic JSON and XML endpoint variants from a single typed method definition.
- Generate Sphinx documentation for your REST API directly from your WSME type annotations and docstrings.
- Add type validation and multi-protocol support to an existing WSGI or Flask application without rewriting routing.
- Create a microservice that exposes the same business logic over REST+JSON and REST+XML simultaneously.
- Prototype a REST API quickly by focusing on business logic while WSME handles serialization and validation.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
WSME simplifies REST API development by letting you define web service methods with type annotations, then automatically handles request parsing, response serialization, and protocol conversion across REST+JSON, REST+XML, and other formats.
Yes, if you're building a REST API in Python and want automatic type validation, multi-protocol support, and self-documenting endpoints without framework lock-in. The low dependency count and permissive license make it a lightweight choice. Verify that the project's maintenance level suits your needs—it's marked active but repository metadata is unavailable, so check the OpenDev repository directly if long-term support is critical.
Install
wsme on PyPI
pip
pip install wsmeuv
uv add wsmepoetry
poetry add wsmeInstalling WSME
Before you install
Low install friction: pure Python wheel with only four runtime dependencies (WebOb, simplegeneric, netaddr, importlib_metadata). Actively maintained as of 32 days ago and marked active.
License in practice
MIT license (permissive) — you can use, modify, and distribute WSME freely in commercial and private projects with minimal restrictions.
Quickstart
pip install WSME
from wsme import WSRoot, expose
class MyService(WSRoot):
@expose(unicode, unicode)
def hello(self, who=u'World'):
return u"Hello {0} !".format(who)
ws = MyService(protocols=['restjson', 'restxml'])
application = ws.wsgiapp()
Requires Python 3.8 or later; designed for WSGI-compatible web frameworks.
Verify before relying
- Whether the package is actively maintained beyond the 32-day release window (repository metadata unavailable).
- Current community adoption and whether the framework is suitable for new projects versus legacy maintenance.
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (>=3.8) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 4 — WebOb, simplegeneric, netaddr, importlib_metadata |
| Maintenance | actively maintained — 32 days since the last release |
| First released | |
| Downloads | 106,954/month — #12,633 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: wsme-0.13.0-py3-none-any.whl
Tags
More Python Modules packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
PyYAMLPyYAML parses and emits YAML 1.1 data format,…
permissive · top 100 on PyPI
pydanticPydantic validates Python data structures…
permissive · top 100 on PyPI
annotated-typesProvides reusable metadata objects for use with…
permissive · top 100 on PyPI
typing-inspectionProvides runtime tools to inspect and…
permissive · top 100 on PyPI
FlaskFlask is a lightweight WSGI web application…
permissive · top 1,000 on PyPI
microversion-parseParses and validates OpenStack microversion…
permissive · top 15,000 on PyPI
oslo.versionedobjectsoslo.versionedobjects provides a versioned…
permissive · top 15,000 on PyPI
asyauthProvides unified authentication handling across…
unclear · top 15,000 on PyPI
oslo.serviceoslo.service provides a framework for building…
permissive · top 15,000 on PyPI
spyneSpyne is a framework for building remote…
copyleft · top 15,000 on PyPI
oslo.middlewareoslo.middleware provides WSGI middleware…
permissive · top 15,000 on PyPI
pyramidPyramid is a Python web framework for building…
permissive · top 5,000 on PyPI
msrestProvides HTTP client runtime and…
permissive · top 1,000 on PyPI
WTForms-ComponentsExtends WTForms with additional field types,…
permissive · top 15,000 on PyPI