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.16.tar.gz (52.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.16-py3-none-any.whl (37.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: univers-21.4.16.tar.gz
  • Upload date:
  • Size: 52.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.16.tar.gz
Algorithm Hash digest
SHA256 525a870b85389aad48d9e6ed079c5f7c39b9e640387b3ad17a96099fb8c8b279
MD5 b12175fe8f110f9cddb45c2fd866f7fe
BLAKE2b-256 3983855c24ab5649532f04cee413ad319206d8689227229a09cf19c581d66298

See more details on using hashes here.

File details

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

File metadata

  • Download URL: univers-21.4.16-py3-none-any.whl
  • Upload date:
  • Size: 37.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.16-py3-none-any.whl
Algorithm Hash digest
SHA256 d481a9b4cdd748c08fe9d7a63f86591beb85d3987db1297d4340a2e407ee9f71
MD5 26a25f780bfce63eb9a064c24781256c
BLAKE2b-256 068ed7cd53cb98d839fa5154667cfd7c3c8b88e87986e25ec8ba51c3cbf8e92b

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

This release

21.4.16 This release

2 files

21.4.9

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