UUID Toolkit
Generate, parse, validate, and convert UUIDs, ULIDs, and NanoIDs. Zero dependencies (Python 3.9+).
Quick Start
CODEBLOCK0
Commands
generate
Create identifiers of any type:
CODEBLOCK1
Types: uuid4, uuid1, uuid3, uuid5, ulid, nanoid, nil.
parse
Extract detailed info from an identifier:
CODEBLOCK2
Shows version, variant, timestamp (v1/ULID), node/MAC (v1), hex, integer.
validate
Check if identifiers are valid:
CODEBLOCK3
convert
Convert UUID between representations:
CODEBLOCK4
Outputs: standard, uppercase, no-dashes, URN, integer, base64, bytes-LE, braces.
UUID 工具包
生成、解析、验证和转换 UUID、ULID 和 NanoID。零依赖(Python 3.9+)。
快速开始
bash
生成一个 UUIDv4
python3 scripts/uuid_toolkit.py generate uuid4
生成 10 个 ULID
python3 scripts/uuid_toolkit.py generate ulid --count 10
解析一个 UUID
python3 scripts/uuid_toolkit.py parse 550e8400-e29b-41d4-a716-446655440000
命令
generate
创建任意类型的标识符:
bash
python3 scripts/uuid_toolkit.py generate uuid4 # 随机 UUID
python3 scripts/uuid_toolkit.py generate uuid1 # 基于时间的 UUID
python3 scripts/uuid_toolkit.py generate uuid5 --name example.com # 确定性 UUID
python3 scripts/uuid_toolkit.py generate ulid # 可排序的 ULID
python3 scripts/uuid_toolkit.py generate nanoid --size 16 # 短 NanoID
python3 scripts/uuid_toolkit.py generate uuid4 --count 100 --upper # 批量生成,大写
python3 scripts/uuid_toolkit.py generate nil # 空 UUID
类型:uuid4、uuid1、uuid3、uuid5、ulid、nanoid、nil。
parse
从标识符中提取详细信息:
bash
python3 scripts/uuid_toolkit.py parse 550e8400-e29b-41d4-a716-446655440000
python3 scripts/uuid_toolkit.py parse 01ARYZ6S41T1ZTXYZ1234ABCDE # ULID
显示版本、变体、时间戳(v1/ULID)、节点/MAC(v1)、十六进制、整数。
validate
检查标识符是否有效:
bash
python3 scripts/uuid_toolkit.py validate 550e8400-e29b-41d4-a716-446655440000 not-a-uuid
convert
在表示形式之间转换 UUID:
bash
python3 scripts/uuid_toolkit.py convert 550e8400-e29b-41d4-a716-446655440000
输出:标准、大写、无连字符、URN、整数、base64、小端字节、花括号。