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 parverVerified import paths — ran on the pinned version, not inferred.
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.
Ensure input version strings conform to PEP 440 specifications. Refer to the official PEP 440 documentation for valid version formats.
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.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.
Install the package using pip: `pip install parver`
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.
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.