versions
Parsing, inspecting and specifying versions.
What it is and what it does
versions is a semantic version parser and matcher for Python. It parses version strings into structured objects with named segments (release, pre-release, dev, local), supports total ordering for comparison, and can match versions against specification sets or individual specifiers. The package also provides utilities to extract version attributes from Python modules.
The library is built on a stack of utility dependencies and is fully typed. It's useful when you need to programmatically work with version constraints—parsing user input, comparing releases, or checking whether a given version satisfies a requirement—rather than relying on string comparison or external tools.
Use it for:
- Parse and compare semantic versions in dependency resolution or package management workflows.
- Match a given version against a version set or specifier to validate compatibility.
- Extract and inspect version components from version strings programmatically.
- Programmatically check version requirements in build scripts or runtime version guards.
- Access the __version__ attribute of installed packages for logging or compatibility checks.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Parses, compares, and validates semantic versions and version specifications, supporting version strings with pre-release, dev, and local segments.
Yes, if you need robust version parsing and matching in your application. The package is production-stable, permissively licensed, has zero known vulnerabilities, and carries low install friction. The main caveat is dormant maintenance—last release was 900 days ago—so if you encounter a bug or need a feature, expect slow or no response. For straightforward version handling, it's a solid choice; for active development requiring rapid fixes, consider the maintenance lag.
Install
versions on PyPI
pip
pip install versionsuv
uv add versionspoetry
poetry add versionsInstalling versions
Before you install
Low install friction; pure Python wheel. Maintenance is dormant—last release was 900 days ago, though the repository remains active with a recent commit. The package is marked production/stable and supports Python 3.8 through 3.12.
License in practice
MIT license is permissive; you can use this package freely in commercial and private projects with minimal restrictions, provided you retain the license notice.
Quickstart
from versions import parse_version, parse_version_set
version = parse_version("1.3.0")
version_set = parse_version_set("^1.0.0")
print(version.matches(version_set)) # True
Requires Python 3.8 or above.
Verify before relying
- Whether the package handles all version specification edge cases or has known limitations.
- Performance characteristics when parsing or comparing large numbers of versions.
- Whether dormant status means the package will receive security updates if vulnerabilities are discovered.
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (>=3.8) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 9 — attrs, typing-aliases, typing-extensions, click, funcs, iters, orderings, solus, entrypoint |
| Maintenance | dormant — 900 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 98,638/month — #13,068 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: versions-2.1.2-py3-none-any.whl
Keywords: python, semver, version
Tags
More Utilities packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
charset-normalizerDetects and normalizes text encoding from…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
pluggyPluggy provides a plugin system that lets you…
permissive · top 100 on PyPI
PygmentsPygments is a syntax highlighter that colorizes…
permissive · top 100 on PyPI
sixSix provides utility functions to write Python…
permissive · top 100 on PyPI
verspecverspec parses and compares software version…
permissive · top 5,000 on PyPI
version-parserParses version strings in multiple formats…
permissive · top 15,000 on PyPI
semverParse, compare, and manipulate semantic version…
permissive · top 1,000 on PyPI
node-semverParses and compares semantic version strings…
permissive · top 5,000 on PyPI
orderingsProvides an Ordering enumeration and Compare…
permissive · top 15,000 on PyPI
single-sourceExtracts your package version from…
permissive · top 15,000 on PyPI
python-semantic-releaseAutomates semantic versioning and release…
permissive · top 5,000 on PyPI
packagingProvides reusable utilities for Python…
permissive · top 100 on PyPI
autosemverAutomatically generates semantic versions for…
copyleft · top 15,000 on PyPI
okonomiyakiOkonomiyaki parses and manipulates metadata for…
permissive · top 15,000 on PyPI