Skip to content

RayID for Python

A lightweight Python library for generating short, readable identifiers.

RayID generates customizable IDs using different character sets. It can be used for tracking logs, events, requests, and other application resources.

PyPI version

Package Information

Property Value
Package rayid
Registry PyPI
Latest Version npm
Python >=3.9
License MIT

Resources

Installation

Using pip:

pip install rayid

Using uv:

uv add rayid

Quick Start

from rayid import RayID

# Create a numeric ID generator
ray = RayID("digit")

# Generate a 16-character ID
identifier = ray.gen(16)

print(identifier)

Character Types

RayID supports four character sets:

Type Characters
digit 0-9
lower a-z
upper A-Z
all Digits + lowercase + uppercase

Examples

from rayid import RayID

# Numeric identifiers
digits = RayID("digit")
print(digits.gen(10))

# Lowercase identifiers
lowercase = RayID("lower")
print(lowercase.gen(10))

# Uppercase identifiers
uppercase = RayID("upper")
print(uppercase.gen(10))

# Mixed alphanumeric identifiers
mixed = RayID("all")
print(mixed.gen(16))

Notes

  • The character type is required when creating a RayID instance.
  • The generated ID length must be a positive integer.
  • For character sets containing digits, generated IDs do not start with 0.
  • Invalid character types raise ValueError.

For the complete API reference and additional examples, visit the official documentation.

License

RayID is distributed under the MIT License.