Skip to main content

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


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.4.0.tar.gz (3.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ordereduuid-0.4.0-py3-none-any.whl (8.2 kB view details)

Uploaded Python 3

File details

Details for the file ordereduuid-0.4.0.tar.gz.

File metadata

  • Download URL: ordereduuid-0.4.0.tar.gz
  • Upload date:
  • Size: 3.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/46.3.0 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.8.2

File hashes

Hashes for ordereduuid-0.4.0.tar.gz
Algorithm Hash digest
SHA256 633e91b6007a1f1a443485f9201a6dd1cb35489858286ed27335adeaa973f05b
MD5 93458240e8fb90bdc9332844b1a8dde1
BLAKE2b-256 ec2fab6789365eec4b79dc75bd2f66acc4c419f779f83aff3f1181f6a4d23cd3

See more details on using hashes here.

File details

Details for the file ordereduuid-0.4.0-py3-none-any.whl.

File metadata

  • Download URL: ordereduuid-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 8.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/46.3.0 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.8.2

File hashes

Hashes for ordereduuid-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6b6e350265730d556524084762c53cf7bb8386f8f46f120f053c86407745e2fd
MD5 fea0242a58068dadc1466987b511c60f
BLAKE2b-256 0887919e880d6755efcec389dd22e8a388f1adf039772560674573104e769a78

See more details on using hashes here.

Supported by

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