February 2026

Generate a Repeatable UUID in Python with UUID v5

The UUID spec provides a way to generate UUIDs that will always be the same for a given input. Useful for things like making RSS feeds where you'll create a file multiple times but what the UUIDs to stay the same without having to store them.

Creating on in Python looks like this:

import uuid

namespace_uuid = uuid.UUID("6ba7b811-9dad-11d1-80b4-00c04fd430c8")
repeatable_uuid = uuid.uuid5(namespace_uuid, "some_string")

print(repeatable_uuid);
Output:
617fa601-38ff-574c-8da0-91565ff5b00b

The namespace_uuid is another UUID that you send in. Threre are a few1 standard ones. You can also use any other valid UUID.

Every time you run that you'll get the same thing.

Very handy,

-a

end of line