{ "info": { "author": "Gabriel Pettier", "author_email": "gabriel@kivy.org", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Topic :: Multimedia :: Sound/Audio", "Topic :: Software Development :: Libraries", "Topic :: System :: Networking" ], "description": "### OSCPy\n\n[![Coverage Status](https://coveralls.io/repos/github/kivy/oscpy/badge.svg?branch=master)](https://coveralls.io/github/kivy/oscpy?branch=master)\n[![Build Status](https://travis-ci.org/kivy/oscpy.svg?branch=master)](https://travis-ci.org/kivy/oscpy)\n\nA modern implementation of OSC for python2/3.\n\n#### What is OSC.\n\nOpenSoundControl is an UDP based network protocol, that is designed for fast\ndispatching of time-sensitive messages, as the name suggests, it was designed\nas a replacement for MIDI, but applies well to other situations. The protocol is\nsimple to use, OSC addresses look like http URLs, and accept various basic\ntypes, such as string, float, int, etc. You can think of it basically as an\nhttp POST, with less overhead.\n\nYou can learn more about OSC on [OpenSoundControl.org](http://opensoundcontrol.org/introduction-osc)\n\n#### Goals\n\n- python2.7/3.6+ compatibility (can be relaxed more on the python3 side\n if needed, but nothing before 2.7 will be supported)\n- fast\n- easy to use\n- robust (returns meaningful errors in case of malformed messages,\n always do the right thing on correct messages)\n- separation of concerns (message parsing vs communication)\n- sync and async compatibility (threads, asyncio, trio\u2026)\n- clean and easy to read code\n\n#### Features\n\n- serialize and parse OSC data types/Messages/Bundles\n- a thread based udp server to open sockets and bind callbacks on osc addresses on them\n- a simple client\n\n#### Install\n```sh\npip install oscpy\n```\n\n#### Usage\n\nServer (thread)\n\n```python\nfrom oscpy.server import OSCThreadServer\nfrom time import sleep\n\ndef callback(values):\n print(\"got values: {}\".format(values))\n\nosc = OSCThreadServer()\nsock = osc.listen(address='0.0.0.0', port=8000, default=True)\nosc.bind(b'/address', callback)\nsleep(1000)\nosc.stop()\n```\n\nor you can use the decorator API.\n\nServer (thread)\n\n```python\nfrom oscpy.server import OSCThreadServer\nfrom time import sleep\n\nosc = OSCThreadServer()\nsock = osc.listen(address='0.0.0.0', port=8000, default=True)\n\n@osc.address(b'/address')\ndef callback(values):\n print(\"got values: {}\".format(values))\n\nsleep(1000)\nosc.stop()\n```\n\nServers are also client, in the sense they can send messages and answer to\nmessages from other servers\n\n```python\nfrom oscpy.server import OSCThreadServer\nfrom time import sleep\n\nosc_1 = OSCThreadServer()\nosc_1.listen(default=True)\n\n@osc_1.address(b'/ping')\ndef ping(*values):\n print(\"ping called\")\n if True in values:\n cont.append(True)\n else:\n osc_1.answer(b'/pong')\n\nosc_2 = OSCThreadServer()\nosc_2.listen(default=True)\n\n@osc_2.address(b'/pong')\ndef pong(*values):\n print(\"pong called\")\n osc_2.answer(b'/ping', [True])\n\nosc_2.send_message(b'/ping', [], *osc_1.getaddress())\n\ntimeout = time() + 1\nwhile not cont:\n if time() > timeout:\n raise OSError('timeout while waiting for success message.')\n```\n\n\nServer (async) (TODO!)\n\n```python\nfrom oscpy.server import OSCThreadServer\n\nwith OSCAsyncServer(port=8000) as OSC:\n for address, values in OSC.listen():\n if address == b'/example':\n print(\"got {} on /example\".format(values))\n else:\n print(\"unknown address {}\".format(address))\n```\n\nClient\n\n```python\nfrom oscpy.client import OSCClient\n\nosc = OSCClient(address, port)\nfor i in range(10):\n osc.send_message(b'/ping', [i])\n```\n\n#### Unicode\n\nBy default, the server and client take bytes (encoded strings), not unicode\nstrings, for osc addresses as well as osc strings. However, you can pass an\n`encoding` parameter to have your strings automatically encoded and decoded by\nthem, so your callbacks will get unicode strings (unicode in python2, str in\npython3).\n\n```python\nosc = OSCThreadServer(encoding='utf8')\nosc.listen(default=True)\n\nvalues = []\n\n@osc.address(u'/encoded')\ndef encoded(*val):\n for v in val:\n assert not isinstance(v, bytes)\n values.append(val)\n\nsend_message(\n u'/encoded',\n [u'hello world', u'\u00e9\u00e9\u00e9\u00e9\u00e9 \u00e0\u00e0\u00e0\u00e0\u00e0'],\n *osc.getaddress(), encoding='utf8')\n```\n\n(`u` literals added here for clarity).\n\n#### CLI\n\nOSCPy provides an \"oscli\" util, to help with debugging:\n- `oscli dump` to listen for messages and dump them\n- `oscli send` to send messages or bundles to a server\n\nSee `oscli -h` for more information.\n\n#### TODO\n\n- real support for timetag (currently only supports optionally\n dropping late bundles, not delaying those with timetags in the future)\n- support for additional argument types\n- an asyncio-oriented server implementation\n- examples & documentation\n\n#### Contributing\n\nCheck out our [contribution guide](CONTRIBUTING.md) and feel free to improve OSCPy.\n\n#### License\n\nOSCPy is released under the terms of the MIT License.\nPlease see the [LICENSE.txt](LICENSE.txt) file.\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/kivy/oscpy", "keywords": "OSC network udp", "license": "", "maintainer": "", "maintainer_email": "", "name": "oscpy", "package_url": "https://pypi.org/project/oscpy/", "platform": "", "project_url": "https://pypi.org/project/oscpy/", "project_urls": { "Bug Reports": "https://github.com/kivy/oscpy/issues", "Homepage": "https://github.com/kivy/oscpy", "Source": "https://github.com/kivy/oscpy" }, "release_url": "https://pypi.org/project/oscpy/0.5.0/", "requires_dist": [ "pytest (>=3.6); extra == 'dev'", "wheel; extra == 'dev'", "pytest-cov; extra == 'dev'", "pycodestyle; extra == 'dev'", "coveralls; extra == 'travis'" ], "requires_python": "", "summary": "A modern and efficient OSC Client/Server implementation", "version": "0.5.0" }, "last_serial": 5682846, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "470165682372a74b88fbb9a4c9a2a054", "sha256": "fc9bc33313968325e3816d82d8f2866ac7792913b19917a8c6d527fbf4ed7d7e" }, "downloads": -1, "filename": "oscpy-0.1.0-py2.py3-none-any.whl", "has_sig": true, "md5_digest": "470165682372a74b88fbb9a4c9a2a054", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 8802, "upload_time": "2018-04-04T01:00:06", "url": "https://files.pythonhosted.org/packages/b8/eb/65ab3b6985d8df9a3ad1b4b9b28d564c900d35fd5f966fbc37b8b15b102e/oscpy-0.1.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "54f98fda71b598bac6814a79cd2f00fc", "sha256": "cd742692f44ad8dcf4f755231bef6951cab4035dca4e727cd6f4fe11d883c8ec" }, "downloads": -1, "filename": "oscpy-0.1.0.tar.gz", "has_sig": true, "md5_digest": "54f98fda71b598bac6814a79cd2f00fc", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 161797, "upload_time": "2018-04-04T01:00:08", "url": "https://files.pythonhosted.org/packages/cb/46/e3d6fc0580e5b050cdd079dc44a08cfd91122606678f6a14e673360ffc06/oscpy-0.1.0.tar.gz" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "9d6de3fce79ce648afc67dc3a681bd45", "sha256": "3124ae6a96713c18f52fd753889d371b28809d3f8c5b92dedcd97745acfffdef" }, "downloads": -1, "filename": "oscpy-0.2.0-py2.py3-none-any.whl", "has_sig": true, "md5_digest": "9d6de3fce79ce648afc67dc3a681bd45", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 10462, "upload_time": "2018-04-09T23:06:14", "url": "https://files.pythonhosted.org/packages/a1/2a/032cf33441c0cc7e7db5518b06a971c3299951b103094dc52a1ca1636b17/oscpy-0.2.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "1dac4447359edafa2d7631ae8fc4db0e", "sha256": "60f93d735f6984833028f38907fceb5ee21b693b8524b91f9ab26df59ab37efc" }, "downloads": -1, "filename": "oscpy-0.2.0.tar.gz", "has_sig": true, "md5_digest": "1dac4447359edafa2d7631ae8fc4db0e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 163444, "upload_time": "2018-04-09T23:06:15", "url": "https://files.pythonhosted.org/packages/02/e0/f7ea8de4e7c2aab0c86dc095bcf6a0ddceb68bf7dc71fb5c1505337dbca9/oscpy-0.2.0.tar.gz" } ], "0.3.0": [ { "comment_text": "", "digests": { "md5": "c921ad6ed78676f9dae4aa38689ac662", "sha256": "8f58914e3078f01a9992bdf8ed72979df244cb2f9ddf5eec911c368e19f29178" }, "downloads": -1, "filename": "oscpy-0.3.0-py2.py3-none-any.whl", "has_sig": true, "md5_digest": "c921ad6ed78676f9dae4aa38689ac662", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 9741, "upload_time": "2018-06-07T01:46:19", "url": "https://files.pythonhosted.org/packages/57/52/9fb6f8d3bd84acec34ba0f60a2cea12ac3a6f726dc7bd956ece2f0ba843e/oscpy-0.3.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "d46494fb3bcb744deb4bea3d0118756e", "sha256": "1ad68e61839a31afaafc9d8792d5b2246f85883aa7d87d33a9676a6ffee053c5" }, "downloads": -1, "filename": "oscpy-0.3.0.tar.gz", "has_sig": true, "md5_digest": "d46494fb3bcb744deb4bea3d0118756e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 164856, "upload_time": "2018-06-07T01:46:21", "url": "https://files.pythonhosted.org/packages/98/36/3349abc043de16615cbe9215f056ba3351dab822980127ff5b4d9453c764/oscpy-0.3.0.tar.gz" } ], "0.4.0": [ { "comment_text": "", "digests": { "md5": "c41f256ef2bb24a1fe1063f49bccd699", "sha256": "07dacf1b4ff10728f98e4a7accbabe8942d094864bac33a6443f435762534fa2" }, "downloads": -1, "filename": "oscpy-0.4.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "c41f256ef2bb24a1fe1063f49bccd699", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 19562, "upload_time": "2019-04-06T12:51:00", "url": "https://files.pythonhosted.org/packages/75/ae/1d10e1e07cac9f7a16b6270f8727dc0ee7c2942755c0085568eb9a7f9296/oscpy-0.4.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "d06b9421a1e7695a123030dcaea3e851", "sha256": "63cafaeb3b4a4dddac8a25159e85bcc50485d1eb8bbaba84045547e9eb25e11d" }, "downloads": -1, "filename": "oscpy-0.4.0.tar.gz", "has_sig": false, "md5_digest": "d06b9421a1e7695a123030dcaea3e851", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 171812, "upload_time": "2019-04-06T12:51:02", "url": "https://files.pythonhosted.org/packages/ae/24/7bf252455192bed5d5e4c5c9d94a34e73953ccc1a20c2a5538b5d69fa74b/oscpy-0.4.0.tar.gz" } ], "0.5.0": [ { "comment_text": "", "digests": { "md5": "c3fda43baf3b65f5586340f87cf87a58", "sha256": "3b5f5e416b4c712441fb7dc5241c22365013087be32007ec0285fbe36e3791b8" }, "downloads": -1, "filename": "oscpy-0.5.0-py2.py3-none-any.whl", "has_sig": true, "md5_digest": "c3fda43baf3b65f5586340f87cf87a58", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 17721, "upload_time": "2019-08-10T10:52:46", "url": "https://files.pythonhosted.org/packages/ac/0b/caba2f9dcfef314947c86c872c096c1109cf6e401cb4a709780400f25c13/oscpy-0.5.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "d2a8876ef031353aa678c75456f870b0", "sha256": "22d4113accd9860e070a974ab8bbc024a9e4d2963a013e6b3a0699b6882ba421" }, "downloads": -1, "filename": "oscpy-0.5.0.tar.gz", "has_sig": true, "md5_digest": "d2a8876ef031353aa678c75456f870b0", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 17048, "upload_time": "2019-08-10T10:52:49", "url": "https://files.pythonhosted.org/packages/0e/fc/d200488a04b6096a204c53c2e3e25124e8b1360e75ff6758324c8ade35d4/oscpy-0.5.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "c3fda43baf3b65f5586340f87cf87a58", "sha256": "3b5f5e416b4c712441fb7dc5241c22365013087be32007ec0285fbe36e3791b8" }, "downloads": -1, "filename": "oscpy-0.5.0-py2.py3-none-any.whl", "has_sig": true, "md5_digest": "c3fda43baf3b65f5586340f87cf87a58", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 17721, "upload_time": "2019-08-10T10:52:46", "url": "https://files.pythonhosted.org/packages/ac/0b/caba2f9dcfef314947c86c872c096c1109cf6e401cb4a709780400f25c13/oscpy-0.5.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "d2a8876ef031353aa678c75456f870b0", "sha256": "22d4113accd9860e070a974ab8bbc024a9e4d2963a013e6b3a0699b6882ba421" }, "downloads": -1, "filename": "oscpy-0.5.0.tar.gz", "has_sig": true, "md5_digest": "d2a8876ef031353aa678c75456f870b0", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 17048, "upload_time": "2019-08-10T10:52:49", "url": "https://files.pythonhosted.org/packages/0e/fc/d200488a04b6096a204c53c2e3e25124e8b1360e75ff6758324c8ade35d4/oscpy-0.5.0.tar.gz" } ] }