skillfed

lexid

Variable width build numbers with lexical ordering.

lexid v2021.1006 534.3K downloads/30d#6,134 on PyPI1
Permissive license MIT Abandoned released

What it is and what it does

lexid is a micro library that generates sequential IDs with a special property: they maintain lexical ordering across their entire sequence, whether you treat them as strings or numbers. This solves a real problem: most tools that read version tags or build numbers use simple string sorting, which fails for normal numeric sequences. lexid works by preemptively incrementing the leftmost digit and expanding padding when needed, so sequences like "0999" → "11000" preserve order even under naive string comparison.

The package provides both a command-line tool and a Python API. It has minimal dependencies—only the standard library—and supports Python 2 and 3. The use case is narrow but concrete: anywhere you need version or build numbers that will be sorted by tools without semantic version parsing, such as git tags read by shell scripts.

Use it for:

  • Generate git version tags that sort correctly when listed with standard sort commands
  • Create build numbers for CI/CD systems that display versions without understanding semantic versioning
  • Produce sequential IDs for systems that rely on lexical string comparison for ordering
  • Maintain version sequences in environments where only basic string sorting is available

Worth the install?

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

Generates lexically ordered numerical IDs that maintain sort order whether compared as integers or strings, useful for build numbers and version tags that need to sort correctly without special parsing.

Yes, but only if you have a specific need for lexically sortable sequential IDs and accept the maintenance risk. The package is abandoned (last commit 2021-05-13) and receives no updates, so it's suitable only for stable, self-contained use cases where you don't expect to need fixes or Python version compatibility updates.

Install

lexid on PyPI

pip

pip install lexid

uv

uv add lexid

poetry

poetry add lexid

Installing lexid

Before you install

Low install friction with only the standard library's typing module as a runtime dependency. Package is marked abandoned with last commit in 2021-05-13, over 1960 days ago, so expect no maintenance or updates.

License in practice

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

Quickstart

$ pip install lexid
$ lexid_incr 1001
1002

Or in Python:
>>> import lexid
>>> lexid.incr("1001")
'1002'

Verify before relying

  • Whether the package remains compatible with Python versions released after 2021-04-02
  • Real-world performance characteristics when generating large sequences of IDs

Package facts

License MIT (permissive)
Python support supports the current Python release (>=2.7)
Install friction low — pure-Python wheel
Runtime dependencies 1 — typing
Maintenance abandoned — 1,960 days since the last release
Last repo commit
First released
Downloads 534,302/month — #6,134 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: lexid-2021.1006-py2.py3-none-any.whl

Keywords: lexical, build, number

Development Status :: 5 - Production/StableEnvironment :: ConsoleEnvironment :: Other EnvironmentIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseOperating System :: MacOS :: MacOS XOperating System :: POSIXOperating System :: UnixProgramming Language :: PythonProgramming Language :: Python :: 2Programming Language :: Python :: 3Programming Language :: Python :: Implementation :: CPythonProgramming Language :: Python :: Implementation :: PyPyTopic :: Software Development :: LibrariesTopic :: Software Development :: Libraries :: Python Modules

Tags

lexical ordering for version numbersbuild number generationsortable id sequencesversion tags that sort correctlystring-comparable sequential idsgit tag orderingvariable-width id incrementation
version-numberingbuild-tools

More Libraries packages