On 21 Feb 2020, at 1:30, Ian Stapleton Cordasco wrote:

How is this different from PyPA's packaging library which has a parser
for PEP 440 versions?
https://github.com/pypa/packaging/blob/master/packaging/version.py

The Version class from packaging normalizes every input, and has no methods for modifying a version number:

>>> from packaging.version import Version
>>> Version('1.alpha')
<Version('1a0')>

parver keeps the version number in the input form, for example if you like a dot before the pre-release tag and prefer 'alpha' to 'a':

>>> from parver import Version
>>> v = Version.parse('1.alpha')
>>> v
<Version '1.alpha'>

parver.Version is immutable, but has methods to derive new versions:

>>> v.bump_pre()
<Version '1.alpha1'>
>>> v = v.replace(pre_tag='beta', pre=0)
>>> v
<Version '1.beta0'>
>>> v.normalize()
<Version '1b0'>