Skip to main content

This package can parse and compare semantic versioning.

Project description

Version Parser

Build Status PyPI version

Der VersionParser kann Versionsnummer parsen und compare welche im format Major-Version, Minor-Version und Build-Version aufgebaut sind.

Mögliche Eingabe Typen sind:

  • v1.2.3
  • V1.2.3
  • v_1_2_3
  • V_1_2_3
  • 1_2_3
  • v1_2_3
  • V1_2_3
  • VM1m2b3
  • VM1m2p3
  • vM1m2b3
  • vM1m2p3
  • 1.2.3
from version_parser.version import Version

>> Version("v2.3.4")


>> Version("v2.3.4") < Version("v2.3.5")



>> v = Version("v2.3.4")
>> v.get_number()
2003004
>> v.get_major_version()
2
>> v.get_minor_version()
3
>> v.get_build_version()
4
>> v.get_type()
VersionType.Version
>> v.get_typed_version(Version.CLASSNAME)
VM2m3b4

VersionTypes

VersionType.FILENAME

"v_{}_{}_{}".format(self._major_version, self._minor_version, self._build_version)

VersionType.CLASSNAME

"VM{}m{}b{}".format(self._major_version, self._minor_version, self._build_version)

VersionType.VERSION

"v{}.{}.{}".format(self._major_version, self._minor_version, self._build_version)

VersionType.STRIPPED_VERSION

"{}.{}.{}".format(self._major_version, self._minor_version, self._build_version)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

version_parser-0.0.2.tar.gz (2.9 kB view details)

Uploaded Source

File details

Details for the file version_parser-0.0.2.tar.gz.

File metadata

  • Download URL: version_parser-0.0.2.tar.gz
  • Upload date:
  • Size: 2.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.20.1 setuptools/40.6.2 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.3

File hashes

Hashes for version_parser-0.0.2.tar.gz
Algorithm Hash digest
SHA256 c4d99bb73bba8750af97c25bd0644f2a2b3722685543ad464f06ddd46e3e76b3
MD5 d054b494d34bfd10da650d8846eff8d1
BLAKE2b-256 2671310cba25975a39d7102868b26c8a3ac96a5e38a48e8525f3b8864484cf03

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page