skillfed

pybase62

Python module for base62 encoding

pybase62 v1.0.0 2.0M downloads/30d#3,367 on PyPI81
License unclear AGING released

What it is and what it does

pybase62 is a Python module for encoding and decoding integers and byte sequences into base62 format, a numeral system using digits 0–9 and letters a–z and A–Z. It was originally written to shorten URLs in web applications by replacing long decimal integers with compact alphanumeric strings. The module supports both integer encoding and byte array encoding, with byte array support available from version 0.2.0 onward.

The main advantage of base62 over base64 is that it contains no special characters like '/' or '=', making it URL-safe and suitable for embedding directly in URLs without escaping. Additionally, base62 preserves the alphabetical order of the original data when encoded, allowing encoded values to be sorted without decoding. The package has no runtime dependencies and supports Python 3.6, 3.7, 3.8, 3.9, 3.10, and 3.11.

Use it for:

  • Generate short, URL-safe identifiers for web application URLs instead of long decimal IDs.
  • Encode binary data into sortable alphanumeric strings for database keys or cache identifiers.
  • Convert large integers into compact representations for logging, analytics, or user-facing IDs.
  • Implement sortable encoding schemes where the encoded form maintains the order of the original values.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Encodes and decodes integers and byte sequences to and from base62 format, a URL-safe alphanumeric representation that preserves sort order.

Yes, if you need base62 encoding and can accept the license ambiguity and aging maintenance status. The package is simple, dependency-free, and widely downloaded (top 5000 on PyPI with 2006651 monthly downloads), but verify the license from the repository before use in proprietary or copyleft-sensitive projects. No known vulnerabilities.

Install

pybase62 on PyPI

pip

pip install pybase62

uv

uv add pybase62

poetry

poetry add pybase62

Installing pybase62

Before you install

Low friction to install; no runtime dependencies. However, the package is aging—last release was 2023-05-29 with no commits since 2026-02-10, so active maintenance is minimal.

License in practice

License treatment is unclear; no SPDX identifier or raw license text is recorded. Before relying on this package in a commercial or copyleft-sensitive context, verify the actual license from the repository.

Quickstart

pip install pybase62

import pybase62

# Encode an integer
encoded = pybase62.encode(34441886726)
print(encoded)  # 'base62'

# Decode back
decoded = pybase62.decode('base62')
print(decoded)  # 34441886726

Verify before relying

  • Exact license terms—license_treatment is 'unclear' and no SPDX or raw license text is provided.
  • Whether the package is actively maintained given the aging status and last commit date of 2026-02-10.

Package facts

License not declared (unclear)
Python support not specified
Install friction low — pure-Python wheel
Runtime dependencies none
Maintenance aging — 1,173 days since the last release
Last repo commit
First released
Downloads 2,006,651/month — #3,367 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: pybase62-1.0.0-py3-none-any.whl

Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.6Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9

Tags

base62 encoding decodingurl-safe integer encodingshort url generationbase62 pythonalphanumeric encodingsortable encoding scheme
encodingurl-safesortable

More Utilities packages