Create time-ordered UUIDs ideal for database keys
Project description
Ordered UUID
Generates UUIDs ordered by time generated.
Overview
Examples
The default constructor generates a UUID using a random multicast MAC address as the node:
>>> from ordereduuid import OrderedUUID
>>> OrderedUUID()
OrderedUUID('1ea96141-1da3-c3ef-e978-ab415e52aca4')
If a private MAC is not preferred, use the set the private_mac
keyword argument to False
:
>>> OrderedUUID(private_mac=False)
OrderedUUID('1ea961a5-25a5-c3bf-e26f-ffffffffffff')
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
Release history Release notifications | RSS feed
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.3.0.tar.gz
(3.3 kB
view hashes)
Built Distribution
Close
Hashes for ordereduuid-0.3.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ae3fee4f7c2431403aa8134628dd9be0c0bc13a9bcd0c81e8372a54ff50de6a5 |
|
MD5 | 6da6eaef728a7fc5c87bae983a9fc3f8 |
|
BLAKE2b-256 | 0eb84cbbb7aa1e74962bfb194fe205afa0c1828b7480dd11b2346700dddf1a01 |