Skip to main content

Python bindings to Rust's UUID library.

Project description

https://travis-ci.com/thedrow/fastuuid.svg?branch=master

FastUUID is a library which provides CPython bindings to Rust’s UUID library.

The provided API is exactly as Python’s builtin UUID class.

It is supported on Python 3.7, 3.8, 3.9, 3.10 & 3.11.

Why?

It is much faster than Python’s pure-python implementation and it is stricter when parsing hexadecimal representation of UUIDs.

If you need to generate a lot of random UUIDs we also provide the uuid4_bulk() function which releases the GIL for the entire duration of the generation. This allows other threads to run while the library generates UUIDs.

Benchmarks

processor

machine

python compiler

python implementation

python implementation version

python version

python build

release

system

cpu

x86_64

x86_64

GCC 5.5.0

CPython

3.7.2

3.7.2

default

4.15.0-50-generic

Linux

Intel(R) Core(TM) i7-7700HQ CPU @ 2.80GHz

name

min

max

mean

stddev

median

iqr

outliers

ops

rounds

iterations

tests/test_benchmarks.py::test_parse_bytes_fastuuid

8.770148269832134e-07

3.0054012313485146e-05

9.848993185755912e-07

6.654121944953314e-07

9.530049283057451e-07

2.6979250833392143e-08

515;8080

1015332.2082162144

149366

1

tests/test_benchmarks.py::test_parse_bytes_uuid

9.00006853044033e-07

2.4181994376704097e-05

1.0102117337399724e-06

6.361040394445994e-07

9.739887900650501e-07

3.899913281202316e-08

1130;10702

989891.4916557473

198020

1

tests/test_benchmarks.py::test_parse_bytes_le_fastuuid

9.00996383279562e-07

2.4662993382662535e-05

1.0116569599011118e-06

5.687526428398989e-07

9.840005077421665e-07

2.200249582529068e-08

703;9368

988477.3590622543

163052

1

tests/test_benchmarks.py::test_parse_bytes_le_uuid

1.348991645500064e-06

3.5200006095692515e-05

1.5184524591452776e-06

9.295692916442362e-07

1.448992406949401e-06

3.897002898156643e-08

1620;12511

658565.2346092485

170271

1

tests/test_benchmarks.py::test_parse_fields_fastuuid

9.819923434406519e-07

3.2625976018607616e-05

1.217285795660234e-06

1.0234898538816672e-06

1.087988493964076e-06

6.702612154185772e-08

3199;12487

821499.7690477591

143844

1

tests/test_benchmarks.py::test_parse_fields_uuid

1.1137977708131076e-06

0.000147809402551502

1.2054474234359692e-06

5.093104655522965e-07

1.144595444202423e-06

6.060581654310231e-08

2304;5896

829567.4954861335

167983

5

tests/test_benchmarks.py::test_parse_hex_fastuuid

9.870273061096668e-07

2.906599547713995e-05

1.11212962918218e-06

6.906885628642859e-07

1.0759977158159018e-06

3.0995579436421394e-08

577;8272

899175.7559191765

143288

1

tests/test_benchmarks.py::test_parse_hex_uuid

1.3360113371163607e-06

2.6262016035616398e-05

1.4448148991822913e-06

7.064083638385458e-07

1.3989920262247324e-06

2.9016518965363503e-08

679;4802

692130.1826039868

82156

1

tests/test_benchmarks.py::test_parse_int_uuid

5.448004230856896e-07

4.164349229540676e-06

6.099919819231937e-07

2.0401652680352933e-07

5.548994522541762e-07

4.430039552971725e-08

3607;3925

1639365.8107557097

87951

20

tests/test_benchmarks.py::test_parse_int_fastuuid

8.950009942054749e-07

4.946498665958643e-05

1.0105578493921953e-06

6.873330198387691e-07

9.739887900650501e-07

2.1012965589761734e-08

529;12534

989552.4542226401

176088

1

tests/test_benchmarks.py::test_fast_uuidv3

5.410998710431158e-07

3.5570512409321965e-06

5.971385425220447e-07

1.672736409563351e-07

5.526497261598707e-07

2.949964255094524e-08

4865;6332

1674653.248434526

83508

20

tests/test_benchmarks.py::test_uuidv3

3.6269775591790676e-06

4.193797940388322e-05

3.933511159797234e-06

1.4521217506191846e-06

3.782013664022088e-06

6.00120984017849e-08

548;4193

254225.79455743768

53582

1

tests/test_benchmarks.py::test_fast_uuidv4

1.47343598655425e-07

2.069187758024782e-06

1.6777362874701377e-07

7.169360028617447e-08

1.5453133528353646e-07

8.188180800061673e-09

6101;11550

5960412.297619802

198413

32

tests/test_benchmarks.py::test_uuidv4

2.275977749377489e-06

5.939402035437524e-05

2.5699563458422217e-06

1.316784132061215e-06

2.38200300373137e-06

1.309963408857584e-07

2068;5815

389111.667837409

85610

1

tests/test_benchmarks.py::test_fast_uuidv4_bulk_threads

0.0009843519947025925

0.007268004992511123

0.0014418828965801719

0.0007545185495019851

0.0012059269938617945

0.0003288870066171512

42;54

693.5375975204223

549

1

tests/test_benchmarks.py::test_fast_uuidv4_threads

0.0030693279986735433

0.008087011985480785

0.004009611603774935

0.000715605913448762

0.0038650799833703786

0.0006588477554032579

53;19

249.40071478707026

273

1

tests/test_benchmarks.py::test_uuidv4_threads

0.030999513022834435

0.06895541000994854

0.040025271589084616

0.009975862168373506

0.036475206492468715

0.008713199000339955

3;2

24.98421522947798

22

1

tests/test_benchmarks.py::test_fast_uuidv5

5.316498572938144e-07

4.090600123163313e-06

5.890041556925782e-07

1.8620985914996815e-07

5.419497028924525e-07

2.9799412004649576e-08

3998;6415

1697780.8905680121

88921

20

tests/test_benchmarks.py::test_uuidv5

3.7190038710832596e-06

5.8079982409253716e-05

4.403547300216035e-06

2.439066121654033e-06

3.910012310370803e-06

2.169981598854065e-07

2283;4139

227089.64655629804

57383

1

Run them yourself to verify.

What’s Missing?

  • UUIDv1 generation

PRs are welcome.

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

test_fastuuid-0.9.1.tar.gz (19.9 kB view details)

Uploaded Source

Built Distributions

test_fastuuid-0.9.1-cp311-none-win_amd64.whl (163.6 kB view details)

Uploaded CPython 3.11 Windows x86-64

test_fastuuid-0.9.1-cp311-cp311-manylinux_2_34_x86_64.whl (275.2 kB view details)

Uploaded CPython 3.11 manylinux: glibc 2.34+ x86-64

test_fastuuid-0.9.1-cp311-cp311-macosx_11_0_arm64.whl (244.6 kB view details)

Uploaded CPython 3.11 macOS 11.0+ ARM64

test_fastuuid-0.9.1-cp310-none-win_amd64.whl (163.6 kB view details)

Uploaded CPython 3.10 Windows x86-64

test_fastuuid-0.9.1-cp310-cp310-manylinux_2_34_x86_64.whl (275.2 kB view details)

Uploaded CPython 3.10 manylinux: glibc 2.34+ x86-64

test_fastuuid-0.9.1-cp310-cp310-macosx_11_0_arm64.whl (244.6 kB view details)

Uploaded CPython 3.10 macOS 11.0+ ARM64

test_fastuuid-0.9.1-cp39-none-win_amd64.whl (163.7 kB view details)

Uploaded CPython 3.9 Windows x86-64

test_fastuuid-0.9.1-cp39-cp39-manylinux_2_34_x86_64.whl (275.3 kB view details)

Uploaded CPython 3.9 manylinux: glibc 2.34+ x86-64

test_fastuuid-0.9.1-cp39-cp39-macosx_11_0_arm64.whl (244.7 kB view details)

Uploaded CPython 3.9 macOS 11.0+ ARM64

test_fastuuid-0.9.1-cp38-none-win_amd64.whl (164.0 kB view details)

Uploaded CPython 3.8 Windows x86-64

test_fastuuid-0.9.1-cp38-cp38-manylinux_2_34_x86_64.whl (275.6 kB view details)

Uploaded CPython 3.8 manylinux: glibc 2.34+ x86-64

test_fastuuid-0.9.1-cp38-cp38-macosx_11_0_arm64.whl (244.9 kB view details)

Uploaded CPython 3.8 macOS 11.0+ ARM64

test_fastuuid-0.9.1-cp37-none-win_amd64.whl (164.0 kB view details)

Uploaded CPython 3.7 Windows x86-64

test_fastuuid-0.9.1-cp37-cp37m-manylinux_2_34_x86_64.whl (275.6 kB view details)

Uploaded CPython 3.7m manylinux: glibc 2.34+ x86-64

File details

Details for the file test_fastuuid-0.9.1.tar.gz.

File metadata

  • Download URL: test_fastuuid-0.9.1.tar.gz
  • Upload date:
  • Size: 19.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.9.19

File hashes

Hashes for test_fastuuid-0.9.1.tar.gz
Algorithm Hash digest
SHA256 c440d54c2fc2a3e05a74319cfebe5d75b2ebf0f09f6020103798183199140d6a
MD5 896735616feb1708d0c4b5c1f4e10be0
BLAKE2b-256 2b22974f0cc0218f9245ace633b69b15cf6033efa366ace6f2b98617e1d142df

See more details on using hashes here.

File details

Details for the file test_fastuuid-0.9.1-cp311-none-win_amd64.whl.

File metadata

File hashes

Hashes for test_fastuuid-0.9.1-cp311-none-win_amd64.whl
Algorithm Hash digest
SHA256 d85459111138911dfa156e5a7cc122bbc911e09bae8cea3b5ca97a1162c939c5
MD5 07d37f30dfe405cd7453d7c7d35b9360
BLAKE2b-256 f1eaec70f8d1b8dd667a108283c3b98353fe3b308d06e215d0d815fddf7bbf0b

See more details on using hashes here.

File details

Details for the file test_fastuuid-0.9.1-cp311-cp311-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for test_fastuuid-0.9.1-cp311-cp311-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 ca94a07625f78f54fc1ae4891dd816d9ac455de0b28df01c96316212e76011b3
MD5 4b7c4f934d9f8e0f9886f2cf357e871f
BLAKE2b-256 e2a67346e86d01fe73c18ce52393f7e46b6aa30ba2e79bdea5af06826d8557a4

See more details on using hashes here.

File details

Details for the file test_fastuuid-0.9.1-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for test_fastuuid-0.9.1-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 735eb618ff149861b65c268edc494d1c94fa8e271e9f72baac73310607aa83ba
MD5 6301331509e449dc38a995387356e114
BLAKE2b-256 5c7ddee0673ff7664ccbe18d5c9389264ba1316d875510498e21536affa587d7

See more details on using hashes here.

File details

Details for the file test_fastuuid-0.9.1-cp310-none-win_amd64.whl.

File metadata

File hashes

Hashes for test_fastuuid-0.9.1-cp310-none-win_amd64.whl
Algorithm Hash digest
SHA256 63867d698c2c2bb29604b1f099804a07091c170a5c4b93b8c2fcb9b1b925fb43
MD5 856629d7c11b939004976a850ffa9e63
BLAKE2b-256 fe33488390c727205847521874e33c84ced802550b3c9eda966acbe55b1df13b

See more details on using hashes here.

File details

Details for the file test_fastuuid-0.9.1-cp310-cp310-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for test_fastuuid-0.9.1-cp310-cp310-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 d220837b0d3a2ed692d902511956fb4a35246254d14ef19911a2accb52b40102
MD5 bff586ab524d0c5942155dc6c46f1f22
BLAKE2b-256 4963d8fbe8376845be55a3146a44f4fe11f1d6cfc9eef7de3aa258904f135436

See more details on using hashes here.

File details

Details for the file test_fastuuid-0.9.1-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for test_fastuuid-0.9.1-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 57b87c5b712ccd86f3ae4cc6b7457d70fe4fbfe6d384911d4368668e2fd21ef4
MD5 3ae3d5915d2f5bc179ac6c12c874bf7a
BLAKE2b-256 ea52e5aaa468026d91d9b631dee902f5e38422b92b027bd0cfabbd92604db811

See more details on using hashes here.

File details

Details for the file test_fastuuid-0.9.1-cp39-none-win_amd64.whl.

File metadata

File hashes

Hashes for test_fastuuid-0.9.1-cp39-none-win_amd64.whl
Algorithm Hash digest
SHA256 f2a96e4b8ac1bc7b4a225f3e6c18295423c2a61fcae4fe367c56297fdd19f802
MD5 369a8cfd004cb05bc291764221be608f
BLAKE2b-256 900172c1e8d9c4bd4363d77f63fecbe7b742766ae20af805c584705a8c757d98

See more details on using hashes here.

File details

Details for the file test_fastuuid-0.9.1-cp39-cp39-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for test_fastuuid-0.9.1-cp39-cp39-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 9bb0289ac1f65bd1657fdd7c3fe92a57c2502d3514fce4446bb9bb662b222cab
MD5 567df81dac825d35cbfb5e97e91ca70e
BLAKE2b-256 bf3f7e41acf8cf80f6dc90123fd8fb862cb732ddf1ca65851d3c4c75b004fd49

See more details on using hashes here.

File details

Details for the file test_fastuuid-0.9.1-cp39-cp39-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for test_fastuuid-0.9.1-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 6123fc1cdb0fa4fd3a960bc74ba2ce3adde217a0b1cc88a17baf67e9389ad381
MD5 46dbc9eedc9dddef14cff610a19b72cf
BLAKE2b-256 536d6d41eac8678d6900e50ca8fc0b49643fa86f07a6b9a4913c2e5b2b13aa5e

See more details on using hashes here.

File details

Details for the file test_fastuuid-0.9.1-cp38-none-win_amd64.whl.

File metadata

File hashes

Hashes for test_fastuuid-0.9.1-cp38-none-win_amd64.whl
Algorithm Hash digest
SHA256 3c934ec52347e0bde6da0f8fe43caa9f876049636a0e0f9c60bff8c5dfdf5b0c
MD5 0c39b79077664d3060ecc659c3b09601
BLAKE2b-256 bbcd9664a6239e92b4e0e63cf371254c783a533e340e6ba6485c39de76d06e81

See more details on using hashes here.

File details

Details for the file test_fastuuid-0.9.1-cp38-cp38-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for test_fastuuid-0.9.1-cp38-cp38-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 2af2fb98c9d033c4ad0e0d00d55b782fd28f9f93de8bd9c12dfb31980c3617d1
MD5 9fa12924c52525b851905570aaa52070
BLAKE2b-256 d84dfdb5a1363591ff0404a0a6a738eeeee690740ffd5bc05c7b6ddb50cc5584

See more details on using hashes here.

File details

Details for the file test_fastuuid-0.9.1-cp38-cp38-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for test_fastuuid-0.9.1-cp38-cp38-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 74df566723b303edd4ea10fd7cb9d29402e93df3129e93e562bff52aab2884d6
MD5 d8e245531a9507ef59fcfb28778177fa
BLAKE2b-256 1639ae30eb6d91385c0a0470eb9ffe71170a05e79e9ba2bcb2f39d253a3604af

See more details on using hashes here.

File details

Details for the file test_fastuuid-0.9.1-cp37-none-win_amd64.whl.

File metadata

File hashes

Hashes for test_fastuuid-0.9.1-cp37-none-win_amd64.whl
Algorithm Hash digest
SHA256 972805b2026eb0d0a2355b0573150d957983f8c97c21b3e578540a48bbaa4342
MD5 2e22433889a55d09d3d6875b5726ad92
BLAKE2b-256 986ad19f1222f91febd09920a74978e0d854e8036eb7c8c3b7d4558f8142c07f

See more details on using hashes here.

File details

Details for the file test_fastuuid-0.9.1-cp37-cp37m-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for test_fastuuid-0.9.1-cp37-cp37m-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 2425fc55917675e4e5c32ca71db39299bc58cbe57963ee30797537a5046461cc
MD5 c3eedd5999f1964a1aaa6fb0725a3289
BLAKE2b-256 e1a75ffaa56c07078b0a9c6789e9b33037ec78ff07bf2f344edf82df81743f9e

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