Python Create UUID from integerMon 06 February 2023
import uuid my_uuid = uuid.UUID(int=1) print(my_uuid)
That should show the following string:
You can also convert back to integer by doing:
For my use case this was needed because my source database has integer based IDs, however the destination database was using UUID based IDs. So converting from integer to UUID was helpful to ensure data can easily be deduplicated.
Review the Python UUID docs for more detailed explanation: Python official docs UUID