Registry / http-networking / python-osc

python-osc

JSON →
library1.10.2pypypi✓ verified 86d ago

Pure Python implementation of the Open Sound Control (OSC) protocol, providing both UDP and TCP server and client classes. Version 1.10.2 supports Python >=3.10. Released irregularly with focus on robustness and simplicity.

pip install python-osc
INSTALL
IMPORT
SIG · PYTHON-OSC
P
python-osc
http-networkingpythonv1.10.2
Install
1.6s avg
Import
203ms
Disk
16MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v1.10.2 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.222s · 18.2MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 1.6s · import 0.184s · 19MB
16MB installed
● package 16MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

SimpleUDPClient
from pythonosc.udp_client import SimpleUDPClient
from pythonosc import SimpleUDPClient
SimpleUDPClient is in the udp_client submodule, not at package root.
SimpleUDPServer
from pythonosc.udp_server import SimpleUDPServer
from pythonosc import SimpleUDPServer
Similar submodule requirement.
OSCPacket
from pythonosc.osc_packet import OscPacket
from pythonosc import OSCPacket
Class is OscPacket with capital O, and under osc_packet module.
OscMessage
from pythonosc.osc_message import OscMessage
from pythonosc import OscMessage
Located in osc_message submodule.

Minimal example to send an OSC message over UDP.

from pythonosc.udp_client import SimpleUDPClient client = SimpleUDPClient("127.0.0.1", 9000) client.send_message("/hello", [1, 2.0, "world"]) print("Sent OSC message to 127.0.0.1:9000")
Debug
Known issues
breakingIn version 1.8.0, the UDP server callback signature changed from (address: str, *osc_args) to (address: str, osc_message: OscMessage). Code using positional args will crash.
fix
Update server handlers to accept OscMessage object and access arguments via osc_message.params.
affects: >=1.8.0
gotchaTCP server and client are available but require explicit import from pythonosc.tcp_server and pythonosc.tcp_client. They have different APIs (e.g., TCP client uses send_message method but may need manual connection).
fix
Use UDP unless you need guaranteed delivery. Check examples in the repository for TCP usage.
affects: all
gotchaThe library does not validate OSC compatibility beyond basic packet structure; malformed messages may be silently dropped or raise cryptic errors.
fix
Always build messages using the provided classes (OscMessage, OscBundle) rather than constructing raw byte strings.
affects: all
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'pythonosc'
Library not installed
fix
pip install python-osc
ImportError: cannot import name 'SimpleUDPClient' from 'pythonosc'
Incorrect import path; SimpleUDPClient is in submodule
fix
from pythonosc.udp_client import SimpleUDPClient
TypeError: handler() takes 2 positional arguments but 3 were given
Server callback signature changed in v1.8.0; old handler expects (addr, *args) but new one passes (addr, message)
fix
Update handler to accept (addr, osc_message) and access arguments via osc_message.params
socket.gaierror: [Errno -2] Name or service not known
Client was given a hostname that cannot be resolved
fix
Use an IP address string like '127.0.0.1' instead of a hostname
Upgrade
Version history
1.10.2latest on PyPI · released Apr 2, 2026
Audit
Dependencies

No dependency data recorded yet.

Agent activity
10 hits · last 30 days
node
8
Resources
python-osc — pip install python-osc · libregistry