Skip to main content

Aiohttp transport for Spyne RPC library

Project description

Build status


Aiohttp transport for Spyne RPC library.


  • Python >= 3.7

  • Aiohttp >= 3.7.0

  • Spyne >= 2.13.16

Spyne alpha versions should also work.


Just run pip install aiohttp-spyne :)


  • Test server: python -m examples.hello_world

  • Threaded test server: python -m examples.hello_world_threads

  • Test client: python -m examples.test_client


First, initialize your spyne application as normal. Here’s an example for a simple SOAP service (See examples for a more complete service setup).

spyne_app = spyne.Application(

Next, wrap your Spyne application with AIOSpyne. Note that you can run your application entrypoints in a thread by setting the threads parameter. If you want to keep your entrypoints running in the same thread as the main application, just leave this None. If you DO run your entrypoints in threads, be aware that some signals sent by spyne will also be run in threads, and be extra careful of using your main loop!

handler = AIOSpyne(spyne_app, threads=25)

Lastly, make an aiohttp application as usual, and just bind GET and POST entrypoints from AIOSpyne to wherever. Note that both paths need to be the same.

With GET, if the request address ends ?wsdl or .wsdl, a WSDL schema is returned in a response. Otherwise requests are redirected to spynes RPC handler.

app = web.Application()
app.router.add_get('/{tail:.*}', handler.get)
web.run_app(app, port=8080)

Testing and formatting

  1. pytest

  2. mypy -p aiohttp_spyne

  3. flake8

  4. black aiohttp_spyne/


LGPL-2.1 – Please see LICENSE for details.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

aiohttp-spyne-1.1.0.tar.gz (15.0 kB view hashes)

Uploaded Source

Built Distribution

aiohttp_spyne-1.1.0-py3-none-any.whl (15.4 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page