messages
Module¶
TypeTags Class¶
-
class
oscpython.messages.
TypeTags
(value: Optional[Any] = None, index: int = -1, tags: List[str] = <factory>)[source]¶ Bases:
oscpython.arguments.StringArgument
Container 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
None
if 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:
object
OSC packet (either
Message
orBundle
)-
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
Bundle
that 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.Packet
An 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
¶ TimeTag
associated with the messageIf present, the
timetag
of theparent_bundle
is used. Otherwise, this will always becommon.TimeTag.Immediately
-
classmethod
create
(address: Union[oscpython.address.Address, str], *args, **kwargs)[source]¶ Convenience method to create a
Message
Creates the
address
field from the provided address string and adds the messagearguments
contained in positional args
-
add_argument
(value: Any) → oscpython.arguments.Argument[source]¶ Create an
Argument
from the given value and add it to thearguments
list.If the value is an instance of
Argument
it 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.Packet
An OSC Bundle
-
timetag
: oscpython.common.TimeTag = TimeTag(seconds=0, fraction=1)¶ The
TimeTag
associated with the bundle
-
packets
: List[oscpython.messages.Packet]¶ List of
Packet
instances to include in the bundle. Elements may be eitherMessage
orBundle
instances (nested bundles are allowed to occur)
-
Exceptions¶
-
class
oscpython.messages.
ParseError
(packet_data: bytes, msg: Optional[str] = None)[source]¶ Bases:
Exception