messages Module¶
TypeTags Class¶
-
class
oscpython.messages.TypeTags(value: Optional[Any] = None, index: int = -1, tags: List[str] = <factory>)[source]¶ Bases:
oscpython.arguments.StringArgumentContainer for OSC typetags
The list of typetags
-
get_pack_value() → Optional[Tuple[bytes]][source]¶ Get the value(s) to be packed using
struct.pack()Returns
Noneif no value is associated with the argument, otherwise a tuple (even if there is only one item)
Packet Class¶
-
class
oscpython.messages.Packet(remote_client: Optional[oscpython.common.Client] = None, parent_bundle: Optional[oscpython.messages.Bundle] = None, parent_index: Optional[int] = None)[source]¶ Bases:
objectOSC packet (either
MessageorBundle)-
remote_client: Optional[oscpython.common.Client] = None¶ If the packet was received, the host that was received from. If sending the packet, the destination host
-
parent_bundle: Optional[oscpython.messages.Bundle] = None¶ Instance of
Bundlethat contains the packet (if any)
-
parent_index: Optional[int] = None¶ Index of the packet within the
parent_bundle
-
Message Class¶
-
class
oscpython.messages.Message(remote_client: Optional[oscpython.common.Client] = None, parent_bundle: Optional[oscpython.messages.Bundle] = None, parent_index: Optional[int] = None, address: oscpython.address.Address = <factory>, arguments: List[oscpython.arguments.Argument] = <factory>)[source]¶ Bases:
oscpython.messages.PacketAn OSC Message
-
address: oscpython.address.Address¶ The OSC address pattern for the message
-
arguments: List[oscpython.arguments.Argument]¶ OSC arguments for the message
-
property
timetag¶ TimeTagassociated with the messageIf present, the
timetagof theparent_bundleis used. Otherwise, this will always becommon.TimeTag.Immediately
-
classmethod
create(address: Union[oscpython.address.Address, str], *args, **kwargs)[source]¶ Convenience method to create a
MessageCreates the
addressfield from the provided address string and adds the messageargumentscontained in positional args
-
add_argument(value: Any) → oscpython.arguments.Argument[source]¶ Create an
Argumentfrom the given value and add it to theargumentslist.If the value is an instance of
Argumentit will be added without copying
-
add_arguments(*values)[source]¶ Create multiple arguments using
add_argument()
-
Bundle Class¶
-
class
oscpython.messages.Bundle(remote_client: Optional[oscpython.common.Client] = None, parent_bundle: Optional[oscpython.messages.Bundle] = None, parent_index: Optional[int] = None, timetag: oscpython.common.TimeTag = TimeTag(seconds=0, fraction=1), packets: List[oscpython.messages.Packet] = <factory>)[source]¶ Bases:
oscpython.messages.PacketAn OSC Bundle
-
timetag: oscpython.common.TimeTag = TimeTag(seconds=0, fraction=1)¶ The
TimeTagassociated with the bundle
-
packets: List[oscpython.messages.Packet]¶ List of
Packetinstances to include in the bundle. Elements may be eitherMessageorBundleinstances (nested bundles are allowed to occur)
-
Exceptions¶
-
class
oscpython.messages.ParseError(packet_data: bytes, msg: Optional[str] = None)[source]¶ Bases:
Exception