Skip to content

Commit 54ad629

Browse files
committed
Update setup.py and README
1 parent 0d910b6 commit 54ad629

File tree

4 files changed

+102
-53
lines changed

4 files changed

+102
-53
lines changed

MANIFEST.in

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
include LICENSE
2-
include README.md
2+
include README.rst
33
include examples/*.py

README.md

-49
This file was deleted.

README.rst

+84
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
=====
2+
aiosc
3+
=====
4+
5+
This is an experimental minimalistic Open Sound Control (OSC) communication
6+
module which uses asyncio for network operations and is compatible with the
7+
asyncio event loop.
8+
9+
Installation
10+
============
11+
12+
aiosc requires at least Python 3.4. It can be installed using pip::
13+
14+
pip3 install aiosc
15+
pip3 install --user aiosc
16+
17+
Usage
18+
=====
19+
20+
To send an OSC message just use ``aiosc.send``:
21+
22+
.. code-block:: python
23+
24+
import asyncio
25+
import aiosc
26+
27+
loop = asyncio.get_event_loop()
28+
loop.run_until_complete(
29+
aiosc.send(('127.0.0.1', 9000), '/hello', 'world')
30+
)
31+
32+
To implement an OSC server with ``aiosc`` you should create an UDP endpoint
33+
using ``aiosc.OSCProtocol`` as the protocol. ``OSCProtocol`` can be subclassed
34+
or directly constructed with a dictionary mapping OSC address patterns to
35+
handler methods for incoming messages:
36+
37+
.. code-block:: python
38+
39+
def protocol_factory():
40+
osc = aiosc.OSCProtocol({
41+
'//*': lambda addr, path, *args: print(addr, path, args)
42+
})
43+
return osc
44+
45+
loop = asyncio.get_event_loop()
46+
coro = loop.create_datagram_endpoint(protocol_factory, local_addr=('127.0.0.1', 9000))
47+
transport, protocol = loop.run_until_complete(coro)
48+
49+
loop.run_forever()
50+
51+
For more examples, see ``examples/``.
52+
53+
OSC address patterns
54+
====================
55+
56+
``aiosc`` dispatches messages to handler methods using glob-style address
57+
pattern matching as described in the OSC 1.0 specification. The ``//`` operator
58+
from OSC 1.1 preliminary specification is also supported.
59+
60+
Examples:
61+
62+
* ``/hello/world`` matches ``/hello/world``.
63+
* ``/hello/*`` matches ``/hello/world`` and ``/hello/sarah``.
64+
* ``/{hello,goodbye}//world`` matches ``/hello/world`` and ``/goodbye/cruel/world``.
65+
* ``//*`` matches any address.
66+
67+
Notes
68+
=====
69+
70+
Bundles are not yet supported.
71+
72+
Contrary to most OSC implementations, OSC data types are picked from the
73+
preliminary spec documented in Features and Future of Open Sound Control
74+
version 1.1 for NIME paper. For example, 'I' typetag is decoded to Impulse
75+
(aka "bang") which is passed around as ``aiosc.Impulse`` singleton.
76+
77+
Suggestions, bug reports, issues and/or pull requests are, of course, welcome.
78+
79+
License
80+
=======
81+
82+
Copyright (c) 2014 Artem Popov <artfwo@gmail.com>
83+
84+
aiosc is licensed under the MIT license, please see LICENSE file for details.

setup.py

+17-3
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,28 @@
11
#! /usr/bin/env python3
2+
23
from setuptools import setup
34

5+
with open('README.rst') as file:
6+
long_description = file.read()
7+
48
setup(
59
name='aiosc',
610
author='Artem Popov',
711
author_email='artfwo@gmail.com',
812
url='https://github.com/artfwo/aiosc',
9-
description='Minimalistic OSC communication module using asyncio.',
10-
version='0.1',
13+
description='Minimalistic Open Sound Control (OSC) communication module using asyncio',
14+
long_description=long_description,
15+
version='0.1.1',
1116
py_modules=['aiosc'],
1217
include_package_data=True,
13-
license='MIT',
18+
classifiers=[
19+
'Development Status :: 4 - Beta',
20+
'Intended Audience :: Developers',
21+
'License :: OSI Approved :: MIT License',
22+
'Programming Language :: Python :: 3',
23+
'Topic :: Multimedia :: Sound/Audio',
24+
'Topic :: Software Development :: Libraries',
25+
'Topic :: System :: Networking',
26+
],
27+
license='MIT'
1428
)

0 commit comments

Comments
 (0)