Skip to main content

A fast UUID generator for Python using Rust

Project description

ruuid

A fast UUID generator for Python built using Rust. Its a simple wrapper on top of Rust's UUID crate.

How to use?

Installation:

pip3 install ruuid==0.3.0 --force --no-cache

Usage:

import ruuid

ruuid.uuid4()

'7a1ef475-904c-4d53-8985-528d09d57414'

Performance

Tests ran on an M1 macbook air with 8 GB of RAM and Python 3.9

from ruuid import uuid4, simple

%timeit simple()
327 ns ± 0.442 ns per loop (mean ± std. dev. of 7 runs, 1000000 loops each)

%timeit uuid4()
348 ns ± 0.707 ns per loop (mean ± std. dev. of 7 runs, 1000000 loops each)

from uuid import uuid4

%timeit uuid4()
1.1 µs ± 2.91 ns per loop (mean ± std. dev. of 7 runs, 1000000 loops each)

Available functions

  • uuid4() - random UUID4 string
  • simple() - formatted simple string of UUID4
  • hyphenated() - hyphenated UUID4 string
  • nil() - a uuid with all zeros
  • urn() - uuid4 as a URN string

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

ruuid-0.3.1.tar.gz (4.2 kB view details)

Uploaded Source

Built Distribution

ruuid-0.3.1-cp36-abi3-manylinux2010_x86_64.whl (167.4 kB view details)

Uploaded CPython 3.6+ manylinux: glibc 2.12+ x86-64

File details

Details for the file ruuid-0.3.1.tar.gz.

File metadata

  • Download URL: ruuid-0.3.1.tar.gz
  • Upload date:
  • Size: 4.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/0.9.1

File hashes

Hashes for ruuid-0.3.1.tar.gz
Algorithm Hash digest
SHA256 fb09b1605f7f91b2140e2cef3f7375d0b9badc2728bb745c18ef40992f252b3b
MD5 4f61482210194b9d74ba996b61ba653e
BLAKE2b-256 adb3b9844c063be3d5cd48bcfaca0bd8661aef017d5bde16b7fa59fc34d56549

See more details on using hashes here.

File details

Details for the file ruuid-0.3.1-cp36-abi3-manylinux2010_x86_64.whl.

File metadata

File hashes

Hashes for ruuid-0.3.1-cp36-abi3-manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 128bb30ddde0a1ca8ed149544f2b7559a37f5212037183bf14e45b307105548a
MD5 9b583e351da86d5ee88fef34316b442e
BLAKE2b-256 06fa93d21cb17c6df70882b964a75da5e5e894fd6fe70b766c4b66e0281cb008

See more details on using hashes here.

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