A fast uuid generator in Python using Rust

Overview

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
You might also like...
Fast and simple datetime, date, time and duration parsing for rust.

speedate Fast and simple datetime, date, time and duration parsing for rust. speedate is a lax† RFC 3339 date and time parser, in other words, it pars

A traditional web forum built in Rust with modern technology to be fast, secure, scalable, and stable.

Volksforo A traditional web forum built in Rust with modern technology to be fast, secure, scalable, and stable. Stack Rust actix-web askama ScyllaDB

A fast rendezvous in rust where data can optionally be swapped between the two threads.

rendezvous_swap A rendezvous is an execution barrier between a pair of threads, but this crate also provides the option of swapping data at the synchr

RcLite: small, fast, and memory-friendly reference counting for Rust

RcLite: small, fast, and memory-friendly reference counting RcLite is a lightweight reference-counting solution for Rust that serves as an alternative

Blazing fast, memory safe & modern Linux package manager written in Rust.

paket Blazing fast, memory safe & modern Linux package manager written in Rust. Roadmap Version: 0.1 Paket.toml file parsing. (#1, #2) CLI handling (p

This is a lightweight audio-video player built in Rust using FFmpeg libraries. It demonstrates the usage of FFmpeg with Rust to play back video files.

FFmpeg Rust Video Player This is a lightweight audio-video player built in Rust using FFmpeg libraries. It demonstrates the usage of FFmpeg with Rust

Automatically deploy from GitHub to Replit, lightning fast ⚡️

repl.deploy Automatically deploy from GitHub to Replit, lightning fast ⚡️ repl.deploy is split into A GitHub app, which listens for code changes and s

A fast, iterative, correct approach to Stackblur, resulting in a very smooth and high-quality output, with no edge bleeding

A fast, iterative, correct approach to Stackblur, resulting in a very smooth and high-quality output, with no edge bleeding. This crate implements a t

Macro for fast implementing serialize methods in serde::Serializer trait

impl_serialize! This library provides a simple procedural macro for fast implementing serialize methods in serde::Serializer trait. [dependencies] imp

Comments
  • GLIBC_2.33 not found

    GLIBC_2.33 not found

    Great idea and thanks for creating this library!

    OS: Ubuntu 18.04 LTS Python: 3.9.6

    Upon running:

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

    and trying to use the package:

    from ruuid import uuid4
    Traceback (most recent call last):
      File "<input>", line 1, in <module>
      File "/home/cjdsellers/.local/share/JetBrains/Toolbox/apps/PyCharm-P/ch-0/212.4746.13/plugins/python/helpers/pydev/_pydev_bundle/pydev_import_hook.py", line 21, in do_import
        module = self._system_import(name, *args, **kwargs)
      File "/home/cjdsellers/.cache/pypoetry/virtualenvs/nautilus-trader-HBeFfK5d-py3.9/lib/python3.9/site-packages/ruuid/__init__.py", line 17, in <module>
        from ruuid.ruuid import hyphenated
      File "/home/cjdsellers/.local/share/JetBrains/Toolbox/apps/PyCharm-P/ch-0/212.4746.13/plugins/python/helpers/pydev/_pydev_bundle/pydev_import_hook.py", line 21, in do_import
        module = self._system_import(name, *args, **kwargs)
    ImportError: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.33' not found (required by /home/cjdsellers/.cache/pypoetry/virtualenvs/nautilus-trader-HBeFfK5d-py3.9/lib/python3.9/site-packages/ruuid/ruuid.abi3.so)
    

    I'm hoping we can avoid the need to ensure a certain libc version dependency?

    opened by cjdsellers 0
Releases(v0.3.0)
Owner
Rahul Nair
Build things fast and move on..>>
Rahul Nair
A relatively simple puzzle generator application written in Rust and used via Javascript

Puzzlip Basic Overview This is a relatively simple puzzle generator application written in Rust and used via Javascript in https://puzzlip.com. If you

Nenad 5 Dec 7, 2022
Local-first linkspage generator

weird.one Local-first linkspage generator Usage You'll need Perseus and SurrealDB. Start the SurrealDB instance. surreal start -u root -p root --log d

Commune 9 Dec 16, 2022
Uniswap V4 Hooks Salt Generator

A lightweight library designed to generate precise salt values with the correct bits prefix for V4 hooks. Simplify your hook development with targeted, easy-to-integrate salt generation.

ts 4 Feb 19, 2024
A Rust-powered linear programming library for Python.

Dantzig: A Rust-powered LP library for Python Dantzig is a lightweight and concise linear programming solver suitable for small and large-scale proble

Matteo Santamaria 4 Jan 10, 2023
Write Anchor-compatible Solana programs in Python

seahorse: Write Solana programs in Python The ease of Python with the safety of Rust. Seahorse lets you write Solana programs in Python. It is a commu

✨ amelia chen ✨ 214 Dec 28, 2022
CSGO demo parser for Python

CSGO demo parser for Python Demo parser for Counter-Strike: Global Offensive. Parser is used to collect data from replay files (".dem" files). The goa

null 11 Dec 7, 2022
Utilities for converting Vega-Lite specs from the command line and Python

VlConvert VlConvert provides a Rust library, CLI utility, and Python library for converting Vega-Lite chart specifications into static images (SVG or

Vega 24 Feb 13, 2023
fast rust implementation of online nonnegative matrix factorization as laid out in the paper "detect and track latent factors with online nonnegative matrix factorization"

ONMF status: early work in progress. still figuring this out. code still somewhat messy. api still in flux. fast rust implementation of online nonnega

null 2 Apr 10, 2020
a super fast scientific calculator with dimensional analysis support written in Rust 🦀

larvae a super fast scientific calculator with dimensional analysis support written in Rust ?? ?? heavily inspired from insect Usage: Command mode: $

John McAvoy 2 Jan 10, 2022
A fast lean and clean modern constraint programming solver implementation (in rust)

MaxiCP-rs This project aims at implementing a fast, and clean constraint programming solver with a focus on correctness, simplicity, maintainability a

Xavier Gillard 5 Dec 10, 2022