looseversion
Version numbering for anarchists and software realists
What it is and what it does
looseversion is a standalone implementation of the version comparison logic from Python's deprecated `distutils.version.LooseVersion`. It handles version strings that don't conform to PEP-440, such as those with arbitrary separators, mixed alphanumeric components, or non-standard ordering schemes. The package is designed as a drop-in replacement, maintaining identical comparison semantics and even allowing direct comparison between looseversion and distutils LooseVersion instances, so tools don't need to coordinate migrations across their dependency tree.
You would use this when you need to parse and compare version numbers from external systems, legacy software, or heterogeneous sources that predate or ignore PEP-440. It's explicitly not recommended for comparing Python package versions—the description points to `packaging.version.Version` for that use case—but it's the right tool when you're working with version schemes outside your control.
Use it for:
- Compare versions from external APIs or systems that use non-standard version numbering schemes
- Migrate away from distutils.version.LooseVersion without rewriting version comparison logic
- Handle version strings from legacy software or heterogeneous sources in a single codebase
- Maintain compatibility across dependencies that may still use the original distutils LooseVersion
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Provides a drop-in replacement for the deprecated `distutils.version.LooseVersion` class, enabling flexible version comparison for non-PEP-440 version schemes.
Yes, if you need to compare non-PEP-440 version strings and want to avoid the deprecated distutils module. It has no dependencies, is actively maintained, and carries a permissive license. Skip it if you're only comparing Python package versions—use packaging.version.Version instead.
Install
looseversion on PyPI
pip
pip install looseversionuv
uv add looseversionpoetry
poetry add looseversionInstalling looseversion
Before you install
Installs with no dependencies and has been actively maintained since its initial release. The repository shows recent activity, making it a low-friction choice for projects that need LooseVersion functionality.
License in practice
Licensed under the Python Software Foundation License, a permissive license that allows reproduction, modification, and distribution with minimal restrictions—suitable for most commercial and open-source projects.
Quickstart
pip install looseversion
from looseversion import LooseVersion
LooseVersion("1.0.0") < LooseVersion("2.0.0") # Returns True
Verify before relying
- Whether this package is maintained as a long-term replacement or a temporary bridge during distutils deprecation
- Performance characteristics when comparing very large numbers of version strings
Package facts
| License | PYTHON SOFTWARE FOUNDATION LICENSE VERSION 2 -------------------------------------------- 1. This LICENSE AGREEMENT is between the Python Software Foundation ("PSF"), and the Individual or… (full text in the JSON record) (permissive) |
| Python support | not specified |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | actively maintained — 1,136 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 1,772,690/month — #3,571 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: looseversion-1.3.0-py2.py3-none-any.whl
Tags
More Application Frameworks packages
FastAPI is a Python web framework for building…
permissive · top 100 on PyPI
annotated-docProvides a way to document function parameters,…
permissive · top 100 on PyPI
textualTextual is a Python framework for building…
permissive · top 100 on PyPI
typerTyper builds command-line applications from…
permissive · top 1,000 on PyPI
mcpBuild and connect to Model Context Protocol…
permissive · top 1,000 on PyPI
WerkzeugWerkzeug is a WSGI utility library providing…
permissive · top 1,000 on PyPI
verlib2Provides standalone version comparison and…
unclear · top 15,000 on PyPI
setuptools-git-versioningAutomatically generates PEP 440-compliant…
permissive · top 5,000 on PyPI
distributeDistribute is a legacy compatibility wrapper…
permissive · top 15,000 on PyPI
verspecverspec parses and compares software version…
permissive · top 5,000 on PyPI
dep-logicPerforms logical operations (AND, OR) on PEP…
permissive · top 5,000 on PyPI
packagingProvides reusable utilities for Python…
permissive · top 100 on PyPI
bumpverBumpVer is a CLI tool that searches for and…
permissive · top 15,000 on PyPI
parverparver parses and manipulates PEP 440 version…
permissive · top 5,000 on PyPI
spacy-legacyProvides legacy registered functions and model…
permissive · top 5,000 on PyPI
bump-my-versionAutomates version number management in projects…
permissive · top 5,000 on PyPI