summaryrefslogtreecommitdiff
path: root/devdocs/python~3.12/library%2Fuuid.html
blob: 942f76f02218614f5ca3e03a4a1f90a29502b36d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
 <span id="uuid-uuid-objects-according-to-rfc-4122"></span><h1>uuid — UUID objects according to RFC 4122</h1> <p><strong>Source code:</strong> <a class="reference external" href="https://github.com/python/cpython/tree/3.12/Lib/uuid.py">Lib/uuid.py</a></p>  <p>This module provides immutable <a class="reference internal" href="#uuid.UUID" title="uuid.UUID"><code>UUID</code></a> objects (the <a class="reference internal" href="#uuid.UUID" title="uuid.UUID"><code>UUID</code></a> class) and the functions <a class="reference internal" href="#uuid.uuid1" title="uuid.uuid1"><code>uuid1()</code></a>, <a class="reference internal" href="#uuid.uuid3" title="uuid.uuid3"><code>uuid3()</code></a>, <a class="reference internal" href="#uuid.uuid4" title="uuid.uuid4"><code>uuid4()</code></a>, <a class="reference internal" href="#uuid.uuid5" title="uuid.uuid5"><code>uuid5()</code></a> for generating version 1, 3, 4, and 5 UUIDs as specified in <span class="target" id="index-1"></span><a class="rfc reference external" href="https://datatracker.ietf.org/doc/html/rfc4122.html"><strong>RFC 4122</strong></a>.</p> <p>If all you want is a unique ID, you should probably call <a class="reference internal" href="#uuid.uuid1" title="uuid.uuid1"><code>uuid1()</code></a> or <a class="reference internal" href="#uuid.uuid4" title="uuid.uuid4"><code>uuid4()</code></a>. Note that <a class="reference internal" href="#uuid.uuid1" title="uuid.uuid1"><code>uuid1()</code></a> may compromise privacy since it creates a UUID containing the computer’s network address. <a class="reference internal" href="#uuid.uuid4" title="uuid.uuid4"><code>uuid4()</code></a> creates a random UUID.</p> <p>Depending on support from the underlying platform, <a class="reference internal" href="#uuid.uuid1" title="uuid.uuid1"><code>uuid1()</code></a> may or may not return a “safe” UUID. A safe UUID is one which is generated using synchronization methods that ensure no two processes can obtain the same UUID. All instances of <a class="reference internal" href="#uuid.UUID" title="uuid.UUID"><code>UUID</code></a> have an <a class="reference internal" href="#uuid.UUID.is_safe" title="uuid.UUID.is_safe"><code>is_safe</code></a> attribute which relays any information about the UUID’s safety, using this enumeration:</p> <dl class="py class"> <dt class="sig sig-object py" id="uuid.SafeUUID">
<code>class uuid.SafeUUID</code> </dt> <dd>
<div class="versionadded"> <p><span class="versionmodified added">New in version 3.7.</span></p> </div> <dl class="py attribute"> <dt class="sig sig-object py" id="uuid.SafeUUID.safe">
<code>safe</code> </dt> <dd>
<p>The UUID was generated by the platform in a multiprocessing-safe way.</p> </dd>
</dl> <dl class="py attribute"> <dt class="sig sig-object py" id="uuid.SafeUUID.unsafe">
<code>unsafe</code> </dt> <dd>
<p>The UUID was not generated in a multiprocessing-safe way.</p> </dd>
</dl> <dl class="py attribute"> <dt class="sig sig-object py" id="uuid.SafeUUID.unknown">
<code>unknown</code> </dt> <dd>
<p>The platform does not provide information on whether the UUID was generated safely or not.</p> </dd>
</dl> </dd>
</dl> <dl class="py class"> <dt class="sig sig-object py" id="uuid.UUID">
<code>class uuid.UUID(hex=None, bytes=None, bytes_le=None, fields=None, int=None, version=None, *, is_safe=SafeUUID.unknown)</code> </dt> <dd>
<p>Create a UUID from either a string of 32 hexadecimal digits, a string of 16 bytes in big-endian order as the <em>bytes</em> argument, a string of 16 bytes in little-endian order as the <em>bytes_le</em> argument, a tuple of six integers (32-bit <em>time_low</em>, 16-bit <em>time_mid</em>, 16-bit <em>time_hi_version</em>, 8-bit <em>clock_seq_hi_variant</em>, 8-bit <em>clock_seq_low</em>, 48-bit <em>node</em>) as the <em>fields</em> argument, or a single 128-bit integer as the <em>int</em> 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:</p> <pre data-language="python">UUID('{12345678-1234-5678-1234-567812345678}')
UUID('12345678123456781234567812345678')
UUID('urn:uuid:12345678-1234-5678-1234-567812345678')
UUID(bytes=b'\x12\x34\x56\x78'*4)
UUID(bytes_le=b'\x78\x56\x34\x12\x34\x12\x78\x56' +
              b'\x12\x34\x56\x78\x12\x34\x56\x78')
UUID(fields=(0x12345678, 0x1234, 0x5678, 0x12, 0x34, 0x567812345678))
UUID(int=0x12345678123456781234567812345678)
</pre> <p>Exactly one of <em>hex</em>, <em>bytes</em>, <em>bytes_le</em>, <em>fields</em>, or <em>int</em> must be given. The <em>version</em> argument is optional; if given, the resulting UUID will have its variant and version number set according to <span class="target" id="index-2"></span><a class="rfc reference external" href="https://datatracker.ietf.org/doc/html/rfc4122.html"><strong>RFC 4122</strong></a>, overriding bits in the given <em>hex</em>, <em>bytes</em>, <em>bytes_le</em>, <em>fields</em>, or <em>int</em>.</p> <p>Comparison of UUID objects are made by way of comparing their <a class="reference internal" href="#uuid.UUID.int" title="uuid.UUID.int"><code>UUID.int</code></a> attributes. Comparison with a non-UUID object raises a <a class="reference internal" href="exceptions#TypeError" title="TypeError"><code>TypeError</code></a>.</p> <p><code>str(uuid)</code> returns a string in the form <code>12345678-1234-5678-1234-567812345678</code> where the 32 hexadecimal digits represent the UUID.</p> </dd>
</dl> <p><a class="reference internal" href="#uuid.UUID" title="uuid.UUID"><code>UUID</code></a> instances have these read-only attributes:</p> <dl class="py attribute"> <dt class="sig sig-object py" id="uuid.UUID.bytes">
<code>UUID.bytes</code> </dt> <dd>
<p>The UUID as a 16-byte string (containing the six integer fields in big-endian byte order).</p> </dd>
</dl> <dl class="py attribute"> <dt class="sig sig-object py" id="uuid.UUID.bytes_le">
<code>UUID.bytes_le</code> </dt> <dd>
<p>The UUID as a 16-byte string (with <em>time_low</em>, <em>time_mid</em>, and <em>time_hi_version</em> in little-endian byte order).</p> </dd>
</dl> <dl class="py attribute"> <dt class="sig sig-object py" id="uuid.UUID.fields">
<code>UUID.fields</code> </dt> <dd>
<p>A tuple of the six integer fields of the UUID, which are also available as six individual attributes and two derived attributes:</p> </dd>
</dl> <table class="docutils align-default">   <tr>
<td><p>Field</p></td> <td><p>Meaning</p></td> </tr> <tr>
<td>
<dl class="py attribute"> <dt class="sig sig-object py" id="uuid.UUID.time_low">
<code>UUID.time_low</code> </dt> <dd></dd>
</dl> </td> <td><p>The first 32 bits of the UUID.</p></td> </tr> <tr>
<td>
<dl class="py attribute"> <dt class="sig sig-object py" id="uuid.UUID.time_mid">
<code>UUID.time_mid</code> </dt> <dd></dd>
</dl> </td> <td><p>The next 16 bits of the UUID.</p></td> </tr> <tr>
<td>
<dl class="py attribute"> <dt class="sig sig-object py" id="uuid.UUID.time_hi_version">
<code>UUID.time_hi_version</code> </dt> <dd></dd>
</dl> </td> <td><p>The next 16 bits of the UUID.</p></td> </tr> <tr>
<td>
<dl class="py attribute"> <dt class="sig sig-object py" id="uuid.UUID.clock_seq_hi_variant">
<code>UUID.clock_seq_hi_variant</code> </dt> <dd></dd>
</dl> </td> <td><p>The next 8 bits of the UUID.</p></td> </tr> <tr>
<td>
<dl class="py attribute"> <dt class="sig sig-object py" id="uuid.UUID.clock_seq_low">
<code>UUID.clock_seq_low</code> </dt> <dd></dd>
</dl> </td> <td><p>The next 8 bits of the UUID.</p></td> </tr> <tr>
<td>
<dl class="py attribute"> <dt class="sig sig-object py" id="uuid.UUID.node">
<code>UUID.node</code> </dt> <dd></dd>
</dl> </td> <td><p>The last 48 bits of the UUID.</p></td> </tr> <tr>
<td>
<dl class="py attribute"> <dt class="sig sig-object py" id="uuid.UUID.time">
<code>UUID.time</code> </dt> <dd></dd>
</dl> </td> <td><p>The 60-bit timestamp.</p></td> </tr> <tr>
<td>
<dl class="py attribute"> <dt class="sig sig-object py" id="uuid.UUID.clock_seq">
<code>UUID.clock_seq</code> </dt> <dd></dd>
</dl> </td> <td><p>The 14-bit sequence number.</p></td> </tr>  </table> <dl class="py attribute"> <dt class="sig sig-object py" id="uuid.UUID.hex">
<code>UUID.hex</code> </dt> <dd>
<p>The UUID as a 32-character lowercase hexadecimal string.</p> </dd>
</dl> <dl class="py attribute"> <dt class="sig sig-object py" id="uuid.UUID.int">
<code>UUID.int</code> </dt> <dd>
<p>The UUID as a 128-bit integer.</p> </dd>
</dl> <dl class="py attribute"> <dt class="sig sig-object py" id="uuid.UUID.urn">
<code>UUID.urn</code> </dt> <dd>
<p>The UUID as a URN as specified in <span class="target" id="index-3"></span><a class="rfc reference external" href="https://datatracker.ietf.org/doc/html/rfc4122.html"><strong>RFC 4122</strong></a>.</p> </dd>
</dl> <dl class="py attribute"> <dt class="sig sig-object py" id="uuid.UUID.variant">
<code>UUID.variant</code> </dt> <dd>
<p>The UUID variant, which determines the internal layout of the UUID. This will be one of the constants <a class="reference internal" href="#uuid.RESERVED_NCS" title="uuid.RESERVED_NCS"><code>RESERVED_NCS</code></a>, <a class="reference internal" href="#uuid.RFC_4122" title="uuid.RFC_4122"><code>RFC_4122</code></a>, <a class="reference internal" href="#uuid.RESERVED_MICROSOFT" title="uuid.RESERVED_MICROSOFT"><code>RESERVED_MICROSOFT</code></a>, or <a class="reference internal" href="#uuid.RESERVED_FUTURE" title="uuid.RESERVED_FUTURE"><code>RESERVED_FUTURE</code></a>.</p> </dd>
</dl> <dl class="py attribute"> <dt class="sig sig-object py" id="uuid.UUID.version">
<code>UUID.version</code> </dt> <dd>
<p>The UUID version number (1 through 5, meaningful only when the variant is <a class="reference internal" href="#uuid.RFC_4122" title="uuid.RFC_4122"><code>RFC_4122</code></a>).</p> </dd>
</dl> <dl class="py attribute"> <dt class="sig sig-object py" id="uuid.UUID.is_safe">
<code>UUID.is_safe</code> </dt> <dd>
<p>An enumeration of <a class="reference internal" href="#uuid.SafeUUID" title="uuid.SafeUUID"><code>SafeUUID</code></a> which indicates whether the platform generated the UUID in a multiprocessing-safe way.</p> <div class="versionadded"> <p><span class="versionmodified added">New in version 3.7.</span></p> </div> </dd>
</dl> <p>The <a class="reference internal" href="#module-uuid" title="uuid: UUID objects (universally unique identifiers) according to RFC 4122"><code>uuid</code></a> module defines the following functions:</p> <dl class="py function"> <dt class="sig sig-object py" id="uuid.getnode">
<code>uuid.getnode()</code> </dt> <dd>
<p>Get the hardware address as a 48-bit positive integer. The first time this runs, it may launch a separate program, which could be quite slow. If all attempts to obtain the hardware address fail, we choose a random 48-bit number with the multicast bit (least significant bit of the first octet) set to 1 as recommended in <span class="target" id="index-4"></span><a class="rfc reference external" href="https://datatracker.ietf.org/doc/html/rfc4122.html"><strong>RFC 4122</strong></a>. “Hardware address” means the MAC address of a network interface. On a machine with multiple network interfaces, universally administered MAC addresses (i.e. where the second least significant bit of the first octet is <em>unset</em>) will be preferred over locally administered MAC addresses, but with no other ordering guarantees.</p> <div class="versionchanged"> <p><span class="versionmodified changed">Changed in version 3.7: </span>Universally administered MAC addresses are preferred over locally administered MAC addresses, since the former are guaranteed to be globally unique, while the latter are not.</p> </div> </dd>
</dl> <span class="target" id="index-5"></span><dl class="py function"> <dt class="sig sig-object py" id="uuid.uuid1">
<code>uuid.uuid1(node=None, clock_seq=None)</code> </dt> <dd>
<p>Generate a UUID from a host ID, sequence number, and the current time. If <em>node</em> is not given, <a class="reference internal" href="#uuid.getnode" title="uuid.getnode"><code>getnode()</code></a> is used to obtain the hardware address. If <em>clock_seq</em> is given, it is used as the sequence number; otherwise a random 14-bit sequence number is chosen.</p> </dd>
</dl> <span class="target" id="index-6"></span><dl class="py function"> <dt class="sig sig-object py" id="uuid.uuid3">
<code>uuid.uuid3(namespace, name)</code> </dt> <dd>
<p>Generate a UUID based on the MD5 hash of a namespace identifier (which is a UUID) and a name (which is a <a class="reference internal" href="stdtypes#bytes" title="bytes"><code>bytes</code></a> object or a string that will be encoded using UTF-8).</p> </dd>
</dl> <span class="target" id="index-7"></span><dl class="py function"> <dt class="sig sig-object py" id="uuid.uuid4">
<code>uuid.uuid4()</code> </dt> <dd>
<p>Generate a random UUID.</p> </dd>
</dl> <span class="target" id="index-8"></span><dl class="py function"> <dt class="sig sig-object py" id="uuid.uuid5">
<code>uuid.uuid5(namespace, name)</code> </dt> <dd>
<p>Generate a UUID based on the SHA-1 hash of a namespace identifier (which is a UUID) and a name (which is a <a class="reference internal" href="stdtypes#bytes" title="bytes"><code>bytes</code></a> object or a string that will be encoded using UTF-8).</p> </dd>
</dl> <p id="index-9">The <a class="reference internal" href="#module-uuid" title="uuid: UUID objects (universally unique identifiers) according to RFC 4122"><code>uuid</code></a> module defines the following namespace identifiers for use with <a class="reference internal" href="#uuid.uuid3" title="uuid.uuid3"><code>uuid3()</code></a> or <a class="reference internal" href="#uuid.uuid5" title="uuid.uuid5"><code>uuid5()</code></a>.</p> <dl class="py data"> <dt class="sig sig-object py" id="uuid.NAMESPACE_DNS">
<code>uuid.NAMESPACE_DNS</code> </dt> <dd>
<p>When this namespace is specified, the <em>name</em> string is a fully qualified domain name.</p> </dd>
</dl> <dl class="py data"> <dt class="sig sig-object py" id="uuid.NAMESPACE_URL">
<code>uuid.NAMESPACE_URL</code> </dt> <dd>
<p>When this namespace is specified, the <em>name</em> string is a URL.</p> </dd>
</dl> <dl class="py data"> <dt class="sig sig-object py" id="uuid.NAMESPACE_OID">
<code>uuid.NAMESPACE_OID</code> </dt> <dd>
<p>When this namespace is specified, the <em>name</em> string is an ISO OID.</p> </dd>
</dl> <dl class="py data"> <dt class="sig sig-object py" id="uuid.NAMESPACE_X500">
<code>uuid.NAMESPACE_X500</code> </dt> <dd>
<p>When this namespace is specified, the <em>name</em> string is an X.500 DN in DER or a text output format.</p> </dd>
</dl> <p>The <a class="reference internal" href="#module-uuid" title="uuid: UUID objects (universally unique identifiers) according to RFC 4122"><code>uuid</code></a> module defines the following constants for the possible values of the <a class="reference internal" href="#uuid.UUID.variant" title="uuid.UUID.variant"><code>variant</code></a> attribute:</p> <dl class="py data"> <dt class="sig sig-object py" id="uuid.RESERVED_NCS">
<code>uuid.RESERVED_NCS</code> </dt> <dd>
<p>Reserved for NCS compatibility.</p> </dd>
</dl> <dl class="py data"> <dt class="sig sig-object py" id="uuid.RFC_4122">
<code>uuid.RFC_4122</code> </dt> <dd>
<p>Specifies the UUID layout given in <span class="target" id="index-10"></span><a class="rfc reference external" href="https://datatracker.ietf.org/doc/html/rfc4122.html"><strong>RFC 4122</strong></a>.</p> </dd>
</dl> <dl class="py data"> <dt class="sig sig-object py" id="uuid.RESERVED_MICROSOFT">
<code>uuid.RESERVED_MICROSOFT</code> </dt> <dd>
<p>Reserved for Microsoft compatibility.</p> </dd>
</dl> <dl class="py data"> <dt class="sig sig-object py" id="uuid.RESERVED_FUTURE">
<code>uuid.RESERVED_FUTURE</code> </dt> <dd>
<p>Reserved for future definition.</p> </dd>
</dl> <div class="admonition seealso"> <p class="admonition-title">See also</p> <dl class="simple"> <dt>
<span class="target" id="index-11"></span><a class="rfc reference external" href="https://datatracker.ietf.org/doc/html/rfc4122.html"><strong>RFC 4122</strong></a> - A Universally Unique IDentifier (UUID) URN Namespace</dt>
<dd>
<p>This specification defines a Uniform Resource Name namespace for UUIDs, the internal format of UUIDs, and methods of generating UUIDs.</p> </dd> </dl> </div> <section id="command-line-usage"> <span id="uuid-cli"></span><h2>Command-Line Usage</h2> <div class="versionadded"> <p><span class="versionmodified added">New in version 3.12.</span></p> </div> <p>The <a class="reference internal" href="#module-uuid" title="uuid: UUID objects (universally unique identifiers) according to RFC 4122"><code>uuid</code></a> module can be executed as a script from the command line.</p> <pre data-language="sh">python -m uuid [-h] [-u {uuid1,uuid3,uuid4,uuid5}] [-n NAMESPACE] [-N NAME]
</pre> <p>The following options are accepted:</p> <dl class="std option"> <dt class="sig sig-object std" id="cmdoption-uuid-h">
<code>-h, --help</code> </dt> <dd>
<p>Show the help message and exit.</p> </dd>
</dl> <dl class="std option"> <dt class="sig sig-object std" id="cmdoption-uuid-u">
<code>-u &lt;uuid&gt;</code> </dt> <dt class="sig sig-object std" id="cmdoption-uuid-uuid">
<code>--uuid &lt;uuid&gt;</code> </dt> <dd>
<p>Specify the function name to use to generate the uuid. By default <a class="reference internal" href="#uuid.uuid4" title="uuid.uuid4"><code>uuid4()</code></a> is used.</p> </dd>
</dl> <dl class="std option"> <dt class="sig sig-object std" id="cmdoption-uuid-n">
<code>-n &lt;namespace&gt;</code> </dt> <dt class="sig sig-object std" id="cmdoption-uuid-namespace">
<code>--namespace &lt;namespace&gt;</code> </dt> <dd>
<p>The namespace is a <code>UUID</code>, or <code>@ns</code> where <code>ns</code> is a well-known predefined UUID addressed by namespace name. Such as <code>@dns</code>, <code>@url</code>, <code>@oid</code>, and <code>@x500</code>. Only required for <a class="reference internal" href="#uuid.uuid3" title="uuid.uuid3"><code>uuid3()</code></a> / <a class="reference internal" href="#uuid.uuid5" title="uuid.uuid5"><code>uuid5()</code></a> functions.</p> </dd>
</dl> <dl class="std option"> <dt class="sig sig-object std" id="cmdoption-uuid-N">
<code>-N &lt;name&gt;</code> </dt> <dt class="sig sig-object std" id="cmdoption-uuid-name">
<code>--name &lt;name&gt;</code> </dt> <dd>
<p>The name used as part of generating the uuid. Only required for <a class="reference internal" href="#uuid.uuid3" title="uuid.uuid3"><code>uuid3()</code></a> / <a class="reference internal" href="#uuid.uuid5" title="uuid.uuid5"><code>uuid5()</code></a> functions.</p> </dd>
</dl> </section> <section id="example"> <span id="uuid-example"></span><h2>Example</h2> <p>Here are some examples of typical usage of the <a class="reference internal" href="#module-uuid" title="uuid: UUID objects (universally unique identifiers) according to RFC 4122"><code>uuid</code></a> module:</p> <pre data-language="python">&gt;&gt;&gt; import uuid

&gt;&gt;&gt; # make a UUID based on the host ID and current time
&gt;&gt;&gt; uuid.uuid1()
UUID('a8098c1a-f86e-11da-bd1a-00112444be1e')

&gt;&gt;&gt; # make a UUID using an MD5 hash of a namespace UUID and a name
&gt;&gt;&gt; uuid.uuid3(uuid.NAMESPACE_DNS, 'python.org')
UUID('6fa459ea-ee8a-3ca4-894e-db77e160355e')

&gt;&gt;&gt; # make a random UUID
&gt;&gt;&gt; uuid.uuid4()
UUID('16fd2706-8baf-433b-82eb-8c7fada847da')

&gt;&gt;&gt; # make a UUID using a SHA-1 hash of a namespace UUID and a name
&gt;&gt;&gt; uuid.uuid5(uuid.NAMESPACE_DNS, 'python.org')
UUID('886313e1-3b8a-5372-9b90-0c9aee199e5d')

&gt;&gt;&gt; # make a UUID from a string of hex digits (braces and hyphens ignored)
&gt;&gt;&gt; x = uuid.UUID('{00010203-0405-0607-0809-0a0b0c0d0e0f}')

&gt;&gt;&gt; # convert a UUID to a string of hex digits in standard form
&gt;&gt;&gt; str(x)
'00010203-0405-0607-0809-0a0b0c0d0e0f'

&gt;&gt;&gt; # get the raw 16 bytes of the UUID
&gt;&gt;&gt; x.bytes
b'\x00\x01\x02\x03\x04\x05\x06\x07\x08\t\n\x0b\x0c\r\x0e\x0f'

&gt;&gt;&gt; # make a UUID from a 16-byte string
&gt;&gt;&gt; uuid.UUID(bytes=x.bytes)
UUID('00010203-0405-0607-0809-0a0b0c0d0e0f')
</pre> </section> <section id="command-line-example"> <span id="uuid-cli-example"></span><h2>Command-Line Example</h2> <p>Here are some examples of typical usage of the <a class="reference internal" href="#module-uuid" title="uuid: UUID objects (universally unique identifiers) according to RFC 4122"><code>uuid</code></a> command line interface:</p> <pre data-language="shell"># generate a random uuid - by default uuid4() is used
$ python -m uuid

# generate a uuid using uuid1()
$ python -m uuid -u uuid1

# generate a uuid using uuid5
$ python -m uuid -u uuid5 -n @url -N example.com
</pre> </section> <div class="_attribution">
  <p class="_attribution-p">
    &copy; 2001&ndash;2023 Python Software Foundation<br>Licensed under the PSF License.<br>
    <a href="https://docs.python.org/3.12/library/uuid.html" class="_attribution-link">https://docs.python.org/3.12/library/uuid.html</a>
  </p>
</div>