skillfed

looseversion

Version numbering for anarchists and software realists

looseversion v1.3.0 1.8M downloads/30d#3,571 on PyPI20
Permissive 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) Active released

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 looseversion

uv

uv add looseversion

poetry

poetry add looseversion

Installing 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

Development Status :: 6 - MatureLicense :: OSI Approved :: Python Software Foundation LicenseProgramming Language :: Python :: 3

Tags

loose version comparisondistutils looseversion replacementnon-pep440 version parsingflexible version numberingversion string comparisonlegacy version schemesheterogeneous version formats
version-comparisondistutils-replacement

More Application Frameworks packages