Skip to main content

Univers: Ecosystem specific version comparision and conversion

Build Status License Python 3.6+

Why ecosystem specific ?

Univers was born out of the need for version comparision at VulnerableCode. Existing tools follow a particular algorithm to evaluate and compare versions. This is not accurate across different ecosystems, since they follow different versioning rules. For example there’s no concept of ‘epoch’ in semver based ecosystem like npm or ruby gems, but epochs do exist in debian ecosystem. The tools solely based on semver or dpkg version spec therefore give different and wrong results in both cases.

Univers is different, it considers the ecosystem of version.

How Univers works ?

Univers, can be considered as a wrapper around many version comparision libraries, each of which solving the problem for the respective ecosystem. It delegates the actual comparision to these libraries depending upon the ecosystem.

The supported ecosystems and underlying libraries are:

  • npm, golang, php-composer, ruby-gems and others which follow the semver spec. These use semantic_version library.

  • debian, this is handled by debian-inspector library.

  • pypi, this is handled by Python’s packaging.version module.

  • maven, this is handled by rpm_vercmp library.

  • ebuild/gentoo, this is handled by gentoo_vercmp module.

Installation

$ pip install univers

Examples

Comparing discrete versions

from univers.version import PYPIVersion
v1 = PYPIVersion("1.2.3")
v2 = PYPIVersion("1.2.4")
assert v1 < v2 == True

Evaluating version ranges

from univers.version import PYPIVersion
from univers.version_specifier import VersionSpecifier

vs = VersionSpecifier.from_scheme_version_spec_string("pypi", ">=1.2.4")
v1 = PYPIVersion("1.2.4")
v2 = PYPIVersion("1.2.3")

assert (v1 in vs ) == True
assert (v2 in vs ) == False

Download files

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

Source Distribution

univers-21.4.9.tar.gz (50.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

univers-21.4.9-py3-none-any.whl (34.3 kB view details)

Uploaded Python 3

File details

Details for the file univers-21.4.9.tar.gz.

File metadata

  • Download URL: univers-21.4.9.tar.gz
  • Upload date:
  • Size: 50.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.10.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.8.5

File hashes

Hashes for univers-21.4.9.tar.gz
Algorithm Hash digest
SHA256 d72d4ba02ac78a92165bc6fe7d085ae68c617217b04014245e61ba54d20c0682
MD5 31dbeebb130841d06341821c1bdf7f67
BLAKE2b-256 0ae70cddcb154440395eda3ad7ed79e05d741198a514109bf72500cc3e282402

See more details on using hashes here.

File details

Details for the file univers-21.4.9-py3-none-any.whl.

File metadata

  • Download URL: univers-21.4.9-py3-none-any.whl
  • Upload date:
  • Size: 34.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.10.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.8.5

File hashes

Hashes for univers-21.4.9-py3-none-any.whl
Algorithm Hash digest
SHA256 a5fd34c2273734737f65035232b2002c267ca99c8521fa8794d9baa8ded79fcf
MD5 db41e8b4f00ee5283060cb6c1a3c4f13
BLAKE2b-256 f11bf1705e7621a0fb19a878d4fdf8e70a0c0a36b5b679a5fd7fb8f80bda2ccc

See more details on using hashes here.

Release history Release notifications | RSS feed

32.0.1

2 files

31.1.0

2 files

31.0.0

2 files

30.12.1

2 files

30.12.0

2 files

30.11.0

2 files

30.10.1

2 files

30.10.0

2 files

30.9.2

2 files

30.9.1

2 files

30.9.0

2 files

30.8.0

2 files

30.7.0

2 files

30.6.0

2 files

30.5.1

2 files

30.5.0

2 files

30.4.0

2 files

30.3.1

2 files

30.3.0

2 files

30.2.0

2 files

30.1.0

2 files

30.0.0

2 files

21.4.16.6

1 file

21.4.16

2 files

This release

21.4.9 This release

2 files

21.4.8

2 files

0.0.1

1 file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page