verlib2
A standalone bundle of "distutils.version" and "packaging.version", without anything else.
What it is and what it does
verlib2 bundles the version-parsing logic from both distutils and the packaging library into a single, lightweight standalone module. It provides LooseVersion and StrictVersion from PEP 386, plus the Version class from PEP 440, without requiring you to add packaging as a dependency or rely on the deprecated distutils standard library.
The package solves a practical problem: many projects need version comparison but want to avoid the overhead of packaging, or they're migrating away from distutils after its removal in Python 3.12. verlib2 bundles both implementations with backward-compatible syntax to support Python 3.6 and later, so you can import what you need and compare versions with a single lightweight dependency.
Use it for:
- Parse and compare versions in build scripts or package management tools without adding packaging as a dependency.
- Handle both PEP 386 (distutils) and PEP 440 (packaging) version formats in legacy or mixed codebases.
- Replace deprecated distutils.version imports in projects targeting Python 3.12 and later where distutils was removed.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Provides standalone version comparison and parsing for PEP 386 and PEP 440 version schemes without requiring the full packaging library or deprecated distutils.
Yes. If you need version parsing and comparison without packaging as a dependency, or you're migrating from distutils, this is a practical drop-in. Low install friction, active maintenance, no known vulnerabilities. License treatment is unclear, so verify the actual license before use in proprietary code.
Install
verlib2 on PyPI
pip
pip install verlib2uv
uv add verlib2poetry
poetry add verlib2Installing verlib2
Before you install
Low friction: pure Python wheel with only two lightweight runtime dependencies (importlib-metadata and typing-extensions). Active maintenance as of 37 days ago with recent commits.
Quickstart
pip install verlib2
from verlib2 import Version
assert Version("1.0.dev456") < Version("1!1.2.rev33+123456")
Verify before relying
- Whether the bundled implementations remain synchronized with upstream projects as they evolve.
- Performance characteristics compared to alternatives for large-scale version comparisons.
Package facts
| License | not declared (unclear) |
| Python support | supports the current Python release (>=3.6) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 2 — importlib-metadata, typing-extensions |
| Maintenance | actively maintained — 37 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 235,494/month — #9,000 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: verlib2-26.2-py3-none-any.whl
Keywords: distutils, packaging, pep386, pep440, version, versioning
Tags
More Libraries packages
urllib3 is an HTTP client library that provides…
permissive · top 100 on PyPI
requestsRequests is a Python HTTP library that…
permissive · top 100 on PyPI
pluggyPluggy provides a plugin system that lets you…
permissive · top 100 on PyPI
python-dateutilProvides parsing, arithmetic, and recurrence…
permissive · top 100 on PyPI
sixSix provides utility functions to write Python…
permissive · top 100 on PyPI
pytestpytest is a testing framework that lets you…
permissive · top 100 on PyPI
looseversionProvides a drop-in replacement for the…
permissive · top 5,000 on PyPI
parverparver parses and manipulates PEP 440 version…
permissive · top 5,000 on PyPI
packagingProvides reusable utilities for Python…
permissive · top 100 on PyPI
packversProvides core utilities for Python package…
permissive · top 15,000 on PyPI
packaging-legacyProvides access to deprecated Python packaging…
permissive · top 15,000 on PyPI
setuptools-git-versioningAutomatically generates PEP 440-compliant…
permissive · top 5,000 on PyPI
dep-logicPerforms logical operations (AND, OR) on PEP…
permissive · top 5,000 on PyPI
distlibDistlib provides low-level packaging utilities…
permissive · top 1,000 on PyPI
awesomeversionParse and compare version strings across…
permissive · top 5,000 on PyPI
distributeDistribute is a legacy compatibility wrapper…
permissive · top 15,000 on PyPI