{"id":2181,"library":"parver","title":"parver: Parse and Manipulate Version Numbers","description":"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.","status":"active","version":"0.5","language":"en","source_language":"en","source_url":"https://github.com/RazerM/parver","tags":["versioning","pep440","semver","packaging","parsing"],"install":[{"cmd":"pip install parver","lang":"bash","label":"Install stable release"}],"dependencies":[{"reason":"Requires Python 3.8 or newer for execution.","package":"python","optional":false}],"imports":[{"symbol":"Version","correct":"from parver import Version"}],"quickstart":{"code":"from parver import Version\n\n# Parse a version string\nv = Version.parse('1.3.0.dev1')\nprint(f\"Original version: {v}\")\n\n# Access parts of the version\nprint(f\"Major: {v.major}, Minor: {v.minor}, Patch: {v.patch}\")\nprint(f\"Is pre-release: {v.is_prerelease}\")\nprint(f\"Development part: {v.dev}\")\n\n# Bump the development version\nv_dev = v.bump_dev()\nprint(f\"Bumped dev version: {v_dev}\")\n\n# Bump a release segment (e.g., patch, which is index 2)\nv_patch = Version.parse('1.2.3').bump_release(index=2)\nprint(f\"Bumped patch version: {v_patch}\")\n\n# Normalize a version\nv_norm = Version.parse('v1.2.alpha-3').normalize()\nprint(f\"Normalized version: {v_norm}\")","lang":"python","description":"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."},"warnings":[{"fix":"Ensure input version strings conform to PEP 440 specifications. Refer to the official PEP 440 documentation for valid version formats.","message":"parver strictly adheres to PEP 440 for version parsing. Providing non-PEP 440 compliant strings may result in `InvalidVersion` exceptions or unexpected parsing behavior.","severity":"gotcha","affected_versions":"All versions"},{"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.","message":"When 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.","severity":"gotcha","affected_versions":"All versions"},{"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.","message":"Users 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).","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"last_verified":"2026-04-09T00:00:00.000Z","next_check":"2026-07-08T00:00:00.000Z"}