common Module¶
StructPacking Class¶
ArgumentList Class¶
-
class
oscpython.common.ArgumentList(initlist=None)[source]¶ Bases:
objectContainer for
Argument-
append(item: oscpython.arguments.Argument)[source]¶ Add an
Argument
-
extend(other)[source]¶ Merge a sequence of
Argumentinstances or anotherArgumentList
-
pack() → bytes[source]¶ Pack all arguments in the list to binary using
struct.pack()
-
values() → Iterable[Any][source]¶ Iterate (flattened) over all argument values (taken from
arguments.Argument.get_pack_value())
-
Client Class¶
TimeTag Class¶
-
class
oscpython.common.TimeTag(seconds: int = 0, fraction: int = 0)[source]¶ Bases:
objectAn OSC timetag represented as two 32-bit integers (formatted as NTP)
The values for
secondsandfractionare relative to the NTP epoch (number of seconds since January 1, 1900).-
Immediately: ClassVar[oscpython.common.TimeTag] = TimeTag(seconds=0, fraction=1)¶ A constant used to send a special-case timetag meaning “immediately”
-
property
is_immediate¶ Whether the special case of “immediately” is indicated
-
to_datetime_utc() → datetime.datetime[source]¶ Create a
datetime.datetimein UTC
-
to_datetime() → datetime.datetime[source]¶ Create a
datetime.datetimewith the local timezone offsetNote
The returned datetime is naive (tzinfo=None)
-
classmethod
from_float(value: float) → oscpython.common.TimeTag[source]¶ Create a
TimeTagfrom an NTP timestamp
-
classmethod
from_epoch(seconds: float) → oscpython.common.TimeTag[source]¶ Create a
TimeTagfrom a POSIX timestamp
-
classmethod
from_datetime(dt: datetime.datetime) → oscpython.common.TimeTag[source]¶ Create a
TimeTagfrom adatetime.datetimeThe timezone behavior of the given datetime matches that of
datetime.datetime.timestamp()
-
classmethod
now() → oscpython.common.TimeTag[source]¶ Create a
TimeTagfrom the current date and time
-
classmethod
utcnow() → oscpython.common.TimeTag[source]¶ Create a
TimeTagusing the current UTC date and time
-