Skip to main content

CustomUUID

CustomUUID is a versatile UUID generation library designed to create unique identifiers with optional embedded information such as dates or custom values. It's ideal for applications requiring unique IDs with additional embedded context.

Table of Contents

Introduction

CustomUUID provides a flexible way to generate UUIDs (Universally Unique Identifiers) with optional embedding of dates, application-specific IDs, or other relevant data. It supports various customization levels, from simple UUIDs to complex ones containing multiple data types.

Features

  • Standard UUID Generation: Generate regular UUIDs compliant with RFC 4122.
  • Date Embedding: Option to embed the current date into the UUID for temporal context.
  • Custom Value Embedding: Embed up to three custom values into the UUID for additional context.
  • Length Management: Automatically handles the length of UUIDs to ensure they stay within standard limits.
  • Predefined Templates: Includes several template functions for common use cases, facilitating ease of use.

Installation

To install CustomUUID, run the following command:

pip install custom_uuid

Usage

Basic Usage Examples with Sample Outputs

  1. Generating a Standard UUID:

    import custom_uuid
    
    standard_uuid = custom_uuid.generate_custom_uuid()
    print("Standard UUID:", standard_uuid)
    

    Output:

    Standard UUID: 123e4567-e89b-12d3-a456-426614174000
    
  2. Generating a UUID with Current Date:

    date_uuid = custom_uuid.uuid_with_date()
    print("UUID with Date:", date_uuid)
    

    Output:

    UUID with Date: 20231109-123e4567-e89b-12d3-a456-426614174000
    
  3. Generating a UUID for a Specific Application:

    app_uuid = custom_uuid.uuid_for_app("MyApp123")
    print("UUID for App:", app_uuid)
    

    Output:

    UUID for App: MyApp123-20231109-123e4567-e89b-12d3-a456-426614174000
    
  4. Generating a Compact UUID Without Separators:

    compact_uuid = custom_uuid.compact_uuid()
    print("Compact UUID:", compact_uuid)
    

    Output:

    Compact UUID: 123e4567e89b12d3a456426614174000
    
  5. Generating a UUID with Custom Elements:

    custom_elements_uuid = custom_uuid.uuid_with_custom_elements("Element1", "Element2")
    print("UUID with Custom Elements:", custom_elements_uuid)
    

    Output:

    UUID with Custom Elements: Element1-Element2-20231109-123e4567-e89b-12d3-a456-426614174000
    
  6. Generating a Timestamped UUID:

    timestamped_uuid = custom_uuid.timestamped_uuid()
    print("Timestamped UUID:", timestamped_uuid)
    

    Output:

    Timestamped UUID: 20231109123000-123e4567-e89b-12d3-a456-426614174000
    

Configuration

CustomUUID allows various configurations to tailor the UUID generation to your specific needs. Refer to the documentation for detailed configuration options.

License

CustomUUID is licensed under the MIT License.

Metadata

Release files for custom_uuid 11.9.23.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for custom_uuid 11.9.23.1
File Size Uploaded
custom_uuid-11.9.23.1.tar.gz 3.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for custom_uuid 11.9.23.1
File Interpreter ABI Platform
custom_uuid-11.9.23.1-py3-none-any.whl Python 3 none any Details

Total release size: 7.8 kB

Release files / custom_uuid-11.9.23.1.tar.gz

Download URL custom_uuid-11.9.23.1.tar.gz
Size 3.3 kB
Tags Source
SHA-256 checksum
How to use checksums
5a2ee13c66b06410c79f330421fd79fd69def641375d6630a166ab2684f2f8e0
BLAKE2b-256 checksum
How to use checksums
811c4140c8cccfb24618349eecf287546e213e4e65741b430df36205eac4e9f5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.6.1 CPython/3.10.12 Linux/5.15.90.1-microsoft-standard-WSL2

Release files / custom_uuid-11.9.23.1-py3-none-any.whl

Download URL custom_uuid-11.9.23.1-py3-none-any.whl
Size 4.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f0d1136e372c402230027defc07b07aada961fc720dabd6b505f70b4be6e13ac
BLAKE2b-256 checksum
How to use checksums
e14f198b272c25495e7ccee0068ea29cf58d476c3fcd99b6e473a842cebf0412
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.6.1 CPython/3.10.12 Linux/5.15.90.1-microsoft-standard-WSL2

Release history Release notifications | RSS feed

This release

11.9.23.1 This release

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page