I used to open a REPL, import uuid and call uuid4() every time I needed an identifier for a test record. Since Python 3.12 the module has its own command line.
python -m uuid
python -m uuid -u uuid1
The default is a random UUID from uuid4(). The -u option picks another generator, so the second line uses uuid1().
There is a name-based form too. uuid3 and uuid5 hash a name inside a namespace, and the namespace can be a UUID or one of the predefined ones: @dns, @url, @oid or @x500.
python -m uuid -u uuid5 -n @url -N example.com
Run that twice and you get the same UUID twice, because the result only depends on the namespace and the name. That makes it useful for stable IDs derived from something you already have.
Python 3.14 added more: -u also accepts uuid6, uuid7 and uuid8, and -C or --count prints several UUIDs in one go.
The caveat is the version. On Python 3.11 and older there is nothing to run, and python -m uuid simply executes the module file without printing anything useful. Check with python --version first, and use the uuid4() one-liner on older systems.
Further reading: Python docs: uuid, command-line usage