Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (
Help us improve Python packaging - Donate today!

Minimalistic Open Sound Control (OSC) communication module using asyncio

Project Description

This is an experimental minimalistic Open Sound Control (OSC) communication module which uses asyncio for network operations and is compatible with the asyncio event loop.


aiosc requires at least Python 3.5. It can be installed using pip:

pip3 install aiosc

Or use –user option to install aiosc locally:

pip3 install --user aiosc


To send an OSC message just use aiosc.send:

import asyncio
import aiosc

loop = asyncio.get_event_loop()
    aiosc.send(('', 9000), '/hello', 'world')

To implement an OSC server with aiosc you should create an UDP endpoint using aiosc.OSCProtocol as the protocol. OSCProtocol can be subclassed or directly constructed with a dictionary mapping OSC address patterns to handler methods for incoming messages:

class EchoServer(aiosc.OSCProtocol):
    def __init__(self):
            '/sys/exit': lambda addr, path, *args: sys.exit(0),
            '//*': self.echo,

    def echo(self, addr, path, *args):
        print("incoming message from {}: {} {}".format(addr, path, args))

loop = asyncio.get_event_loop()
coro = loop.create_datagram_endpoint(EchoServer, local_addr=('', 9000))
transport, protocol = loop.run_until_complete(coro)


For more examples, see examples/.

OSC address patterns

aiosc dispatches messages to handler methods using glob-style address pattern matching as described in the OSC 1.0 specification. The // operator from OSC 1.1 preliminary specification is also supported.


  • /hello/world matches /hello/world.
  • /hello/* matches /hello/world and /hello/sarah.
  • /{hello,goodbye}//world matches /hello/world and /goodbye/cruel/world.
  • //* matches any address.


Bundles are not yet supported.

Contrary to most OSC implementations, OSC data types are picked from the preliminary spec documented in Features and Future of Open Sound Control version 1.1 for NIME paper. For example, ‘I’ typetag is decoded to Impulse (aka “bang”) which is passed around as aiosc.Impulse singleton.

Suggestions, bug reports, issues and/or pull requests are, of course, welcome.


Copyright (c) 2014 Artem Popov <>

aiosc is licensed under the MIT license, please see LICENSE file for details.

Release History

Release History

This version
History Node


History Node


History Node


Download Files

Download Files

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

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
aiosc-0.1.3.tar.gz (5.2 kB) Copy SHA256 Checksum SHA256 Source Dec 5, 2017

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS 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