This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
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.

Installation

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

pip3 install aiosc
pip3 install --user aiosc

Usage

To send an OSC message just use aiosc.send:

import asyncio
import aiosc

loop = asyncio.get_event_loop()
loop.run_until_complete(
    aiosc.send(('127.0.0.1', 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:

def protocol_factory():
    osc = aiosc.OSCProtocol({
        '//*': lambda addr, path, *args: print(addr, path, args)
    })
    return osc

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

loop.run_forever()

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.

Examples:

  • /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.

Notes

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.

License

Copyright (c) 2014 Artem Popov <artfwo@gmail.com>

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

Release History

Release History

0.1.1

This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

TODO: Brief introduction on what you do with files - including link to relevant help section.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
aiosc-0.1.1.tar.gz (5.1 kB) Copy SHA256 Checksum SHA256 Source Jul 26, 2014

Supported By

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