$npx skillfedfor your agent

nanoid

A tiny, secure, URL-friendly, unique string ID generator for Python

With conditionsPyPI UtilitiesReleased Nov 20186.5M downloads / moMITPure Python

Decision gist · record as of 2026-08-14

pure-Python wheel — nanoid-2.0.0-py3-none-any.whl
v2.0.0 · released 2018-11-20

Yes, if you need short, secure, URL-safe IDs. The package is lightweight, dependency-free, and actively maintained in its repository. The 2018 PyPI release date warrants verification that the version on PyPI matches your needs, but the active repository status and zero security vulnerabilities make it a solid choice for ID generation.AI-flagged interpretation of the facts on this page — verify before relying

Before you install

  • Low friction: pure Python wheel with no runtime dependencies.
  • Maintenance is active with recent commits, though the latest PyPI release is from 2018.

License · maintenance · safety

MIT (permissive) — MIT license is permissive and imposes no restrictions on use, modification, or distribution in commercial or private projects.

last release 2018-11-20 (2824 days) · last repo commit 2026-04-13 · 512 stars

0 known vulnerabilities (OSV.dev, 2026-08-14) · 6,492,585 downloads/mo, #1,902 on PyPI

Verify before relying

pip install nanoid

from nanoid import generate

generate()  # => NDzkGoTCdRcaRyt7GOepg
generate(size=10)  # => "IRFa-VaY2b"
generate('1234567890abcdef', 10)  # => "4f9zd13a42"
  • Whether the 2018 latest_release date reflects a genuine maintenance gap or if newer versions exist only in the repository
  • Specific collision probability guarantees for the default 21-character ID length
  • Performance characteristics compared to UUID generation
Same gist for agents: .md · .json

What it is and what it does

nanoid is a lightweight ID generator that produces cryptographically secure, URL-safe unique strings. It uses a larger alphabet (A-Za-z0-9_-) than UUID, reducing the default ID length from 36 to 21 characters while maintaining similar collision probability. The package offers both a secure default generator and a faster non-secure variant, and supports custom alphabets and lengths for tuning collision risk versus ID compactness.

The library has no external dependencies and installs as a pure Python wheel, making it simple to add to any project. It's designed for scenarios where you need short, web-safe identifiers—such as URL slugs, database record IDs, or session tokens—without the overhead of UUID's longer format.

Use it for

  • Generate short, unique identifiers for database records or API resources that need to appear in URLs
  • Create session tokens or temporary identifiers for web applications where compactness matters
  • Build URL slugs or short links that are collision-resistant and safe to embed in query strings
  • Replace UUID in scenarios where the 21-character format is preferable to UUID's 36-character standard
  • Generate non-sequential IDs for distributed systems where collision probability is tuned to your scale

Worth the install?

AI-flagged interpretation of the facts on this page. Verify before relying on it.

With conditions

Yes, if you need short, secure, URL-safe IDs.

The package is lightweight, dependency-free, and actively maintained in its repository. The 2018 PyPI release date warrants verification that the version on PyPI matches your needs, but the active repository status and zero security vulnerabilities make it a solid choice for ID generation.

Install

nanoid on PyPI

Before you install

Low friction: pure Python wheel with no runtime dependencies. Maintenance is active with recent commits, though the latest PyPI release is from 2018.

License in practice

MIT license is permissive and imposes no restrictions on use, modification, or distribution in commercial or private projects.

Quickstart

pip install nanoid

from nanoid import generate

generate()  # => NDzkGoTCdRcaRyt7GOepg
generate(size=10)  # => "IRFa-VaY2b"
generate('1234567890abcdef', 10)  # => "4f9zd13a42"

Verify before relying

  • Whether the 2018 latest_release date reflects a genuine maintenance gap or if newer versions exist only in the repository
  • Specific collision probability guarantees for the default 21-character ID length
  • Performance characteristics compared to UUID generation

Package facts

LicenseMIT permissive
Python supportNot specified
Install frictionLow. Pure-Python wheel
Runtime dependenciesNone
MaintenanceActively maintained 2,824 days since the last release
Last repo commit
First released
Downloads6,492,585 / month, #1,902 on PyPI 30-day window, as of 2026-08-14
Known vulnerabilitiesNone known OSV.dev, checked 2026-08-14
Classifiers
License :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: PythonTopic :: Utilities

Evidence: nanoid-2.0.0-py3-none-any.whl

Tags

Capabilities
unique id generatorsecure random idurl-friendly idnano id pythonuuid alternativeshort unique stringcollision-resistant id
Topics
id-generationcryptographyurl-safe

Let your AI agent find packages like this

Example. Real query, live index.

You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.

wish › “secure random id”

  • nanoidGenerates cryptographically secure, URL-friendly unique IDs shorter…
  • shortuuidGenerates concise, URL-safe unique identifiers by encoding UUIDs into…
  • fastnanoidGenerates unique, URL-friendly string IDs using a Rust-backed…

Give your agent the search over MCP, or paste the wish link into any chat.

More Utilities packages

idna Worth it
PyPI · Python Modules · released Jun 2026

Converts domain names between Unicode and ASCII-compatible encoding (Punycode) according to IDNA 2008 and Unicode Technical Standard 46, with security validation and broader script coverage than the standard library.

Install it if you work with internationalized domain names, need to validate domains, or use HTTP clients that depend on it transitively.

BSD-3-Clausepure Python · 3.9+
1.8Bdownloads / mo
charset-normalizer Worth it
PyPI · Utilities · released Aug 2026

Detects and normalizes text encoding from unknown or ambiguous sources, supporting all IANA character sets that Python's core library provides codecs for, with the ability to register custom codecs.

permissive licensepure Python · 3.7+
1.7Bdownloads / mo
setuptools Worth it
PyPI · Python Modules · released Aug 2026

Setuptools is a Python build backend and package management tool that handles building, distributing, and installing Python packages, including support for C/C++ extension modules.

MITpure Python · 3.10+
1.6Bdownloads / mo
pluggy Worth it
PyPI · Libraries · released May 2025

Pluggy provides a plugin system that lets you define hook specifications and register implementations to be called in sequence, enabling extensible Python applications without tight coupling.

Install it if you're building an extensible application or framework.

MITpure Python · 3.9+aging
1.3Bdownloads / mo
Pygments Worth it
PyPI · Utilities · released Mar 2026

Pygments is a syntax highlighter that colorizes source code and text in over 500 languages and formats, outputting to HTML, LaTeX, RTF, SVG, images, or ANSI terminal sequences.

Install it if you need to display or transform source code.

BSD-2-Clausepure Python · 3.9+
1.3Bdownloads / mo
six With conditions
PyPI · Libraries · released Dec 2024

Six provides utility functions to write Python code that runs on both Python 2.7 and Python 3.3+, smoothing over language differences between the two versions.

MITpure Python
1.2Bdownloads / mo

See also fastnanoid · shortuuid · cuid2 · sqids · ulid · timeflake · ulid-py · hashids · py-machineid · uuid