Registry / serialization / shortid

shortid

JSON →
library0.1.2pypypi✓ verified 94d ago

A short id generator for Python, producing compact, URL-friendly unique identifiers. Version 0.1.2 is the latest release; the library appears to be in maintenance mode with no recent updates.

pip install shortid
INSTALL
IMPORT
SIG · SHORTID
S
shortid
serializationpythonv0.1.2
Install
2.4s avg
Import
10ms
Disk
17MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.9–3.13
musl
3.9–3.13
Install & Compatibility
Where this runs
tested against v0.1.2 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.10–3.95 runs
installs and imports cleanly · install 0.0s · import 0.010s · 19.2MB
glibc
py 3.10–3.95 runs
installs and imports cleanly · install 2.4s · import 0.008s · 20MB
17MB installed
● package 17MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

ShortId
✓ from shortid import ShortId
✗ import shortid
Direct module import does not provide the class; you must import ShortId explicitly.

Generate a short, URL-friendly unique identifier.

from shortid import ShortId sid = ShortId() short_id = sid.generate() print(short_id) # e.g., 'B1rH9k'
Debug
Known issues
gotchaShortId() without arguments uses default alphabet (case-sensitive alphanumeric). Generated IDs are not cryptographically random; use secrets module if you need stronger uniqueness.
fix
If you need secure IDs, consider a different library or use secrets.token_urlsafe()
affects: all
deprecatedThe library has not been updated since 2017 and may not support modern Python versions (3.10+). Build failures possible.
fix
Test with your Python version; if broken, consider alternatives like shortuuid or pyshorteners.
affects: 0.1.2
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'shortid'
The package is not installed.
fix
Run: pip install shortid
ImportError: cannot import name 'ShortId' from 'shortid'
Incorrect import path.
fix
Use: from shortid import ShortId
Upgrade
Version history
0.1.2latest on PyPI · released Mar 27, 2017
Audit
Dependencies

No dependency data recorded yet.

Agent activity
15 hits · last 30 days
node
12
Resources
shortid — pip install shortid · libregistry