Skip to content

Instantly share code, notes, and snippets.

@k3z
Created September 22, 2014 11:56
Show Gist options
  • Save k3z/0b8afa6265de249740c1 to your computer and use it in GitHub Desktop.
Save k3z/0b8afa6265de249740c1 to your computer and use it in GitHub Desktop.
from faker import Faker
from faker.providers import BaseProvider
from faker import Factory
class UuidProvider(BaseProvider):
def uuid_reset(self):
self._uui_counter = 0
def uuid4(self):
if not hasattr(self, '_uui_counter'):
self._uui_counter = 0
self._uui_counter += 1
return '00000000-0000-0000-0000-%012d' % self._uui_counter
fake = Factory.create('fr_FR')
fake.add_provider(UuidProvider)
fake.seed(4321)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment