Attributes
- bytes
bytes = property(get_bytes)
- bytes_le
bytes_le = property(get_bytes_le)
- clock_seq
clock_seq = property(get_clock_seq)
- clock_seq_hi_variant
clock_seq_hi_variant = property(get_clock_seq_hi_variant)
- clock_seq_low
clock_seq_low = property(get_clock_seq_low)
- fields
fields = property(get_fields)
- hex
hex = property(get_hex)
- node
node = property(get_node)
- time
time = property(get_time)
- time_hi_version
time_hi_version = property(get_time_hi_version)
- time_low
time_low = property(get_time_low)
- time_mid
time_mid = property(get_time_mid)
- urn
urn = property(get_urn)
- variant
variant = property(get_variant)
- version
version = property(get_version)
Method summary
- __cmp__(self, other)
- __hash__(self)
- __init__(self, hex = None, bytes = None, bytes_le = None, fields = None, int = None, version = None)
- __int__(self)
- __repr__(self)
- __setattr__(self, name, value)
- __str__(self)
- get_bytes(self)
- get_bytes_le(self)
- get_clock_seq(self)
- get_clock_seq_hi_variant(self)
- get_clock_seq_low(self)
- get_fields(self)
- get_hex(self)
- get_node(self)
- get_time(self)
- get_time_hi_version(self)
- get_time_low(self)
- get_time_mid(self)
- get_urn(self)
- get_variant(self)
- get_version(self)
Methods
- __cmp__(self, other)
- __hash__(self)
- __init__(self, hex = None, bytes = None, bytes_le = None, fields = None, int = None, version = None)
Create a UUID from either a string of 32 hexadecimal digits, a string of 16 bytes as the 'bytes' argument, a string of 16 bytes in little-endian order as the 'bytes_le' argument, a tuple of six integers (32-bit time_low, 16-bit time_mid, 16-bit time_hi_version, 8-bit clock_seq_hi_variant, 8-bit clock_seq_low, 48-bit node) as the 'fields' argument, or a single 128-bit integer as the 'int' argument. When a string of hex digits is given, curly braces, hyphens, and a URN prefix are all optional. For example, these expressions all yield the same UUID:
- UUID('{12345678-1234-5678-1234-567812345678}')
- UUID('12345678123456781234567812345678')
- UUID('urn:uuid:12345678-1234-5678-1234-567812345678')
- UUID(bytes='x12x34x56x78'*4)
- UUID(bytes_le='x78x56x34x12x34x12x78x56' + 'x12x34x56x78x12x34x56x78')
- UUID(fields=(0x12345678, 0x1234, 0x5678, 0x12, 0x34, 0x567812345678))
- UUID(int=0x12345678123456781234567812345678)
Exactly one of 'hex', 'bytes', 'bytes_le', 'fields', or 'int' must be given. The 'version' argument is optional; if given, the resulting UUID will have its variant and version set according to RFC 4122, overriding the given 'hex', 'bytes', 'bytes_le', 'fields', or 'int'.
- __int__(self)
- __repr__(self)
- __setattr__(self, name, value)
- __str__(self)
- get_bytes(self)
- get_bytes_le(self)
- get_clock_seq(self)
- get_clock_seq_hi_variant(self)
- get_clock_seq_low(self)
- get_fields(self)
- get_hex(self)
- get_node(self)
- get_time(self)
- get_time_hi_version(self)
- get_time_low(self)
- get_time_mid(self)
- get_urn(self)
- get_variant(self)
- get_version(self)