{"id":13419725,"url":"https://github.com/attwad/python-osc","last_synced_at":"2025-10-21T19:04:28.866Z","repository":{"id":9435622,"uuid":"11310488","full_name":"attwad/python-osc","owner":"attwad","description":"Open Sound Control server and client in pure python","archived":false,"fork":false,"pushed_at":"2024-08-17T19:02:31.000Z","size":311,"stargazers_count":515,"open_issues_count":41,"forks_count":106,"subscribers_count":27,"default_branch":"master","last_synced_at":"2024-10-10T07:28:08.196Z","etag":null,"topics":["osc","python","sound"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"unlicense","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/attwad.png","metadata":{"files":{"readme":"README.rst","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2013-07-10T11:44:16.000Z","updated_at":"2024-10-07T21:27:43.000Z","dependencies_parsed_at":"2024-10-26T23:03:03.182Z","dependency_job_id":null,"html_url":"https://github.com/attwad/python-osc","commit_stats":{"total_commits":286,"total_committers":37,"mean_commits":7.72972972972973,"dds":0.7272727272727273,"last_synced_commit":"913fd5c1dad1b3adc8aa7551f572833518f95b2e"},"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/attwad%2Fpython-osc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/attwad%2Fpython-osc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/attwad%2Fpython-osc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/attwad%2Fpython-osc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/attwad","download_url":"https://codeload.github.com/attwad/python-osc/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243690112,"owners_count":20331726,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["osc","python","sound"],"created_at":"2024-07-30T22:01:19.880Z","updated_at":"2025-10-21T19:04:23.605Z","avatar_url":"https://github.com/attwad.png","language":"Python","readme":"==========\npython-osc\n==========\n\nOpen Sound Control server and client implementations in **pure python**.\n\n.. image:: https://github.com/attwad/python-osc/actions/workflows/python-test.yml/badge.svg\n    :target: https://github.com/attwad/python-osc/actions/workflows/python-test.yml\n\n\nCurrent status\n==============\n\nThis library was developed following the\n`OpenSoundControl Specification 1.0 \u003chttps://opensoundcontrol.stanford.edu/spec-1_0.html\u003e`_\nand is currently in a stable state.\n\nFeatures\n========\n\n* UDP blocking/threading/forking/asyncio server implementations\n* UDP client\n* int, int64, float, string, double, MIDI, timestamps, blob, nil OSC arguments\n* simple OSC address\u003c-\u003ecallback matching system\n* extensive unit test coverage\n* basic client and server examples\n\nDocumentation\n=============\n\nAvailable at https://python-osc.readthedocs.io/.\n\nInstallation\n============\n\npython-osc is a pure python library that has no external dependencies,\nto install it just use pip (prefered):\n\n.. image:: https://img.shields.io/pypi/v/python-osc.svg\n    :target: https://pypi.python.org/pypi/python-osc\n\n.. code-block:: bash\n\n    $ pip install python-osc\n\nExamples\n========\n\nSimple client\n-------------\n\n.. code-block:: python\n\n  \"\"\"Small example OSC client\n\n  This program sends 10 random values between 0.0 and 1.0 to the /filter address,\n  waiting for 1 seconds between each value.\n  \"\"\"\n  import argparse\n  import random\n  import time\n\n  from pythonosc import udp_client\n\n\n  if __name__ == \"__main__\":\n    parser = argparse.ArgumentParser()\n    parser.add_argument(\"--ip\", default=\"127.0.0.1\",\n        help=\"The ip of the OSC server\")\n    parser.add_argument(\"--port\", type=int, default=5005,\n        help=\"The port the OSC server is listening on\")\n    args = parser.parse_args()\n\n    client = udp_client.SimpleUDPClient(args.ip, args.port)\n\n    for x in range(10):\n      client.send_message(\"/filter\", random.random())\n      time.sleep(1)\n\nSimple server\n-------------\n\n.. code-block:: python\n\n  \"\"\"Small example OSC server\n\n  This program listens to several addresses, and prints some information about\n  received packets.\n  \"\"\"\n  import argparse\n  import math\n\n  from pythonosc.dispatcher import Dispatcher\n  from pythonosc import osc_server\n\n  def print_volume_handler(unused_addr, args, volume):\n    print(\"[{0}] ~ {1}\".format(args[0], volume))\n\n  def print_compute_handler(unused_addr, args, volume):\n    try:\n      print(\"[{0}] ~ {1}\".format(args[0], args[1](volume)))\n    except ValueError: pass\n\n  if __name__ == \"__main__\":\n    parser = argparse.ArgumentParser()\n    parser.add_argument(\"--ip\",\n        default=\"127.0.0.1\", help=\"The ip to listen on\")\n    parser.add_argument(\"--port\",\n        type=int, default=5005, help=\"The port to listen on\")\n    args = parser.parse_args()\n\n    dispatcher = Dispatcher()\n    dispatcher.map(\"/filter\", print)\n    dispatcher.map(\"/volume\", print_volume_handler, \"Volume\")\n    dispatcher.map(\"/logvolume\", print_compute_handler, \"Log volume\", math.log)\n\n    server = osc_server.ThreadingOSCUDPServer(\n        (args.ip, args.port), dispatcher)\n    print(\"Serving on {}\".format(server.server_address))\n    server.serve_forever()\n\nBuilding bundles\n----------------\n\n.. code-block:: python\n\n    from pythonosc import osc_bundle_builder\n    from pythonosc import osc_message_builder\n\n    bundle = osc_bundle_builder.OscBundleBuilder(\n        osc_bundle_builder.IMMEDIATELY)\n    msg = osc_message_builder.OscMessageBuilder(address=\"/SYNC\")\n    msg.add_arg(4.0)\n    # Add 4 messages in the bundle, each with more arguments.\n    bundle.add_content(msg.build())\n    msg.add_arg(2)\n    bundle.add_content(msg.build())\n    msg.add_arg(\"value\")\n    bundle.add_content(msg.build())\n    msg.add_arg(b\"\\x01\\x02\\x03\")\n    bundle.add_content(msg.build())\n\n    sub_bundle = bundle.build()\n    # Now add the same bundle inside itself.\n    bundle.add_content(sub_bundle)\n    # The bundle has 5 elements in total now.\n\n    bundle = bundle.build()\n    # You can now send it via a client as described in other examples.\n\nLicense?\n========\nUnlicensed, do what you want with it. (http://unlicense.org)\n","funding_links":[],"categories":["Python"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fattwad%2Fpython-osc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fattwad%2Fpython-osc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fattwad%2Fpython-osc/lists"}