{"id":3850,"library":"verspec","title":"Flexible Version Handling","description":"verspec is a Python library for handling software versions and specifiers, adapted from the `packaging` package. It provides a flexible API for parsing, comparing, and working with version strings, supporting both 'loose' and 'Python' (PEP 440) version schemes. The current version is 0.1.0, released in November 2020. As an initial release, its release cadence is not yet established.","status":"active","version":"0.1.0","language":"en","source_language":"en","source_url":"https://github.com/jimporter/verspec","tags":["versioning","packaging","PEP 440","specifiers","comparison"],"install":[{"cmd":"pip install verspec","lang":"bash","label":"Install latest version"}],"dependencies":[],"imports":[{"note":"Classes like `Version` and `SpecifierSet` are exposed under submodules `loose` and `python`.","symbol":"loose.Version","correct":"from verspec import loose"},{"note":"Classes like `Version` and `SpecifierSet` are exposed under submodules `loose` and `python`.","symbol":"python.Version","correct":"from verspec import python"},{"note":"Classes like `Version` and `SpecifierSet` are exposed under submodules `loose` and `python`.","symbol":"loose.SpecifierSet","correct":"from verspec import loose"},{"note":"Classes like `Version` and `SpecifierSet` are exposed under submodules `loose` and `python`.","symbol":"python.SpecifierSet","correct":"from verspec import python"}],"quickstart":{"code":"from verspec import loose, python\n\n# Using the 'loose' version scheme\nv_loose = loose.Version('1.0')\ns_loose = loose.SpecifierSet('~=1.0')\nassert v_loose in s_loose\nprint(f\"Loose Version '{v_loose}' is in specifier '{s_loose}': {v_loose in s_loose}\")\n\n# Using the 'python' (PEP 440) version scheme\nv_python = python.Version('1.0')\ns_python = python.SpecifierSet('~=1.0')\nassert v_python in s_python\nprint(f\"Python Version '{v_python}' is in specifier '{s_python}': {v_python in s_python}\")\n","lang":"python","description":"This example demonstrates how to import and use both the 'loose' and 'python' (PEP 440 compliant) version and specifier classes to check if a version satisfies a given specifier."},"warnings":[{"fix":"Thoroughly test version parsing and comparison logic when upgrading to new `verspec` versions. Consult the GitHub repository's `CHANGES.md` or commit history for potential changes if official documentation is still unavailable.","message":"The library is explicitly marked as 'Alpha' (Development Status: 3 - Alpha on PyPI) and its documentation is currently 'Forthcoming!'. This indicates that the API surface might be unstable, and future releases (even minor ones) may introduce breaking changes or significant behavioral differences without explicit deprecation warnings.","severity":"gotcha","affected_versions":"0.1.0"},{"fix":"Always explicitly import from either `verspec.loose` or `verspec.python` and consistently use the appropriate classes for a given context. For PyPI-style versioning and dependency resolution, `verspec.python` should be preferred.","message":"The library provides two distinct version schemes: `verspec.loose` (for a more liberal interpretation of versions) and `verspec.python` (for PEP 440 compliant versioning). Mixing these types or using `loose` where strict PEP 440 compliance is required (e.g., for package dependency resolution) can lead to unexpected or incorrect comparison results.","severity":"gotcha","affected_versions":"0.1.0"}],"env_vars":null,"last_verified":"2026-04-11T00:00:00.000Z","next_check":"2026-07-10T00:00:00.000Z"}