Skip to main content

Create time-ordered UUIDs ideal for database keys

Project description

Ordered UUID

Generates UUIDs ordered by time generated.



The default constructor generates a UUID using a random multicast MAC address as the node:

>>> from ordereduuid import OrderedUUID
>>> OrderedUUID()

If a private MAC is not preferred, use the set the private_mac keyword argument to False:

>>> OrderedUUID(private_mac=False)

REQUIRES TESTING/REVIEW -- UUIDs generated are designed to be used as keys in databases. Consider the following Django example:

from django.db import models

from ordereduuid import OrderedUUID

class Subscriber(models.Model):
    id = models.UUIDField(
        primary_key=True, default=OrderedUUID, editable=False

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ordereduuid-0.5.0.tar.gz (4.0 kB view hashes)

Uploaded source

Built Distribution

ordereduuid-0.5.0-py3-none-any.whl (8.7 kB view hashes)

Uploaded py3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page