common
Module¶
StructPacking Class¶
ArgumentList Class¶
-
class
oscpython.common.
ArgumentList
(initlist=None)[source]¶ Bases:
object
Container for
Argument
-
append
(item: oscpython.arguments.Argument)[source]¶ Add an
Argument
-
extend
(other)[source]¶ Merge a sequence of
Argument
instances 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:
object
An OSC timetag represented as two 32-bit integers (formatted as NTP)
The values for
seconds
andfraction
are 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.datetime
in UTC
-
to_datetime
() → datetime.datetime[source]¶ Create a
datetime.datetime
with the local timezone offsetNote
The returned datetime is naive (tzinfo=None)
-
classmethod
from_float
(value: float) → oscpython.common.TimeTag[source]¶ Create a
TimeTag
from an NTP timestamp
-
classmethod
from_epoch
(seconds: float) → oscpython.common.TimeTag[source]¶ Create a
TimeTag
from a POSIX timestamp
-
classmethod
from_datetime
(dt: datetime.datetime) → oscpython.common.TimeTag[source]¶ Create a
TimeTag
from adatetime.datetime
The timezone behavior of the given datetime matches that of
datetime.datetime.timestamp()
-
classmethod
now
() → oscpython.common.TimeTag[source]¶ Create a
TimeTag
from the current date and time
-
classmethod
utcnow
() → oscpython.common.TimeTag[source]¶ Create a
TimeTag
using the current UTC date and time
-