Registry / devops / version-parser

version-parser

JSON →
library1.0.1pypypi✓ verified 85d ago

A lightweight Python package to parse and compare semantic versioning strings. Current version 1.0.1, low release cadence.

pip install version-parser
INSTALL
IMPORT
SIG · VERSION-PARSER
V
version-parser
devopspythonv1.0.1
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

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

VersionParser
from version_parser import Version
from version_parser import VersionParser
The class is named Version, not VersionParser

Parse and access version parts.

from version_parser import Version v = Version('1.2.3') print(v.major, v.minor, v.patch) # 1 2 3 print(v == Version('1.2.3')) # True
Debug
Known issues
gotchaThe main class is named Version, not VersionParser. Common mistake: from version_parser import VersionParser fails.
fix
Use: from version_parser import Version
affects: all
deprecatedThe package uses 'version_parser' as module name, but pip package is 'version-parser' (hyphen vs underscore).
fix
Use correct install command and import.
affects: all
gotchaVersion strings must be strictly semver (e.g., '1.2.3'). Pre-release or build metadata may cause unexpected behavior.
fix
Ensure version string matches MAJOR.MINOR.PATCH pattern (no 'v' prefix).
affects: all
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'version_parser'
Installed wrong package or forgot to install.
fix
Run: pip install version-parser (note hyphen, not underscore). Then import: from version_parser import Version
AttributeError: module 'version_parser' has no attribute 'VersionParser'
Trying to import 'VersionParser' which does not exist.
fix
Use: from version_parser import Version
Upgrade
Version history
1.0.1latest on PyPI · released Jan 6, 2021
Audit
Dependencies

No dependency data recorded yet.

Agent activity
4 hits · last 30 days
node
4
Resources
version-parser — pip install version-parser · libregistry