Registry / serialization / parver

parver

JSON →
library1.0.1.post0pypypi✓ verified 23d ago

parver is a Python package designed for robust parsing and manipulation of PEP 440 compliant version numbers. It provides a `Version` class to represent versions and methods for common operations like bumping development or release segments, checking pre-release status, and normalization. The library is currently at version 0.5 and maintains a stable, active development status.

pip install parver
INSTALL
IMPORT
SIG · PARVER
P
parver
serializationpythonv1.0.1.post0
Install
1.6s avg
Import
64ms
Disk
16MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v1.0.1.post0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.068s · 18MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 1.6s · import 0.060s · 18MB
16MB installed
● package 16MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Version
from parver import Version

This quickstart demonstrates how to parse a version string into a `Version` object, access its components, and perform common manipulations such as bumping development or release segments, and normalizing the version format.

from parver import Version # Parse a version string v = Version.parse('1.3.0.dev1') print(f"Original version: {v}") # Access parts of the version print(f"Major: {v.major}, Minor: {v.minor}, Patch: {v.patch}") print(f"Is pre-release: {v.is_prerelease}") print(f"Development part: {v.dev}") # Bump the development version v_dev = v.bump_dev() print(f"Bumped dev version: {v_dev}") # Bump a release segment (e.g., patch, which is index 2) v_patch = Version.parse('1.2.3').bump_release(index=2) print(f"Bumped patch version: {v_patch}") # Normalize a version v_norm = Version.parse('v1.2.alpha-3').normalize() print(f"Normalized version: {v_norm}")
Debug
Known issues
gotchaparver strictly adheres to PEP 440 for version parsing. Providing non-PEP 440 compliant strings may result in `InvalidVersion` exceptions or unexpected parsing behavior.
fix
Ensure input version strings conform to PEP 440 specifications. Refer to the official PEP 440 documentation for valid version formats.
affects: All versions
gotchaWhen comparing `Version` objects, ensure both operands are `Version` instances for reliable and consistent results. While some direct comparisons with strings might work, it's generally safer to explicitly parse strings into `Version` objects before comparison.
fix
Always parse version strings into `Version` objects (e.g., `Version.parse('1.0')`) before performing comparisons with other `Version` objects or if specific PEP 440 comparison logic is desired.
affects: All versions
gotchaUsers accustomed to Semantic Versioning (SemVer) might find `parver`'s `bump_*` methods behave differently. `parver` follows PEP 440's interpretation of version segments, which may not align directly with SemVer's `major.minor.patch` increment rules (e.g., `bump_release(index=2)` is used for patch).
fix
Consult the `parver` documentation for the precise behavior of `bump_major()`, `bump_minor()`, `bump_patch()`, and `bump_release(index=...)` to ensure it matches the desired versioning strategy. For strict SemVer, consider a dedicated SemVer library or adapt `parver`'s methods carefully.
affects: All versions
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'parver'
The 'parver' package is not installed in the Python environment where you are trying to use it.
fix
Install the package using pip: `pip install parver`
packaging.version.InvalidVersion: Invalid version: 'some_malformed_version_string'
The version string provided to `parver.Version.parse()` does not strictly conform to the PEP 440 specification, which `parver` enforces by leveraging `packaging.version`.
fix
Ensure the version string is a valid PEP 440 compliant format. For example, '1.2.3' is valid, but 'v1.2.3' or '1.2.3.ALPHA' are not directly parsable without pre-processing.
AttributeError: 'Version' object has no attribute 'non_existent_attribute'
You are attempting to access an attribute (e.g., 'major', 'minor', 'patch', 'is_prerelease') on a `parver.Version` object that either does not exist or is not directly accessible in the way you are trying to use it. This can also occur if you try to assign a new value to a version segment, as `Version` objects are immutable.
fix
Consult the `parver` documentation or source code for available attributes and methods. To create a new version with modifications, use methods like `bump_major()`, `bump_minor()`, `bump_patch()`, `replace()`, etc., which return a *new* `Version` object rather than modifying the existing one.
Upgrade
Version history
1.0.1.post0latest on PyPI · released Jul 30, 2026
Audit
Dependencies
pythonrequiredRequires Python 3.8 or newer for execution.
Agent activity
5 hits · last 30 days
node
4
Resources
parver — pip install parver · libregistry