Base64 UUIDs in Python

By Christine Lemmer-Webber on Tue 30 July 2013

Hardly even worth writing about, but maybe it's useful to someone. Ever want a base 64 encoded UUID4 in python? I ported the uuid.uuid4() code over for base64 encoding, with a slight cleanup function to make it URL safe.

UPDATE: Making this the most useless blogpost I've already

: written, there's already a urlsave_b64encode method (also, I thus removed the rest of the post above):

>>> base64.urlsafe_b64encode(uuid.uuid4().bytes).strip("=")