versus
Package version comparison made easy.
versus is a standalone, portable, dependency-free Python module for retrieving and comparing installed package versions. It supports variety of lookups, such as lte, lt, gte, gt and eq.
Prerequisites
Python 3.9+
Installation
pip
pip install versus
Download and copy
versus.py is the sole, self-contained module of the package. It includes tests too. If it’s more convenient to you, you could simply download the versus.py module and include it in your repository.
Since tests are included, it won’t have a negative impact on your test coverage (you might need to tweak your test/coverage configuration).
Documentation
Documentation is available on Read the Docs.
For guidelines on contributing check the Contributor guidelines.
Usage
Comparing Django versions.
from versus import get_version
django_version = get_version("django")
print(django_version) # 5.2.1
django_version.gte("4.2") # True
django_version.gte("5.2") # True
django_version.gte("5.2.1") # True
django_version.gte("5.2.2") # False
Comparing sphinx-autobuild versions:
sphinx_autobuild_version = get_version("sphinx-autobuild")
print(sphinx_autobuild_version) # 2024.10.3
sphinx_autobuild_version.gte("1.0") # True
sphinx_autobuild_version.gte("2024.09") # True
sphinx_autobuild_version.gte("2024.11") # False
sphinx_autobuild_version.lte("2024.11") # True
Non-existent/non-installed package lookup would return None:
nonexistent_package = get_version("nonexistent-package")
print(nonexistent_package) # None
Tests
Run the tests with unittest:
python -m unittest versus
Or pytest:
pytest
Writing documentation
Keep the following hierarchy.
=====
title
=====
header
======
sub-header
----------
sub-sub-header
~~~~~~~~~~~~~~
sub-sub-sub-header
^^^^^^^^^^^^^^^^^^
sub-sub-sub-sub-header
++++++++++++++++++++++
sub-sub-sub-sub-sub-header
**************************
License
MIT
Support
For security issues contact me at the e-mail given in the Author section.
For overall issues, go to GitHub.
Metadata
Release files for versus 0.1.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| versus-0.1.4.tar.gz | 6.9 kB | Without provenance | Details for versus-0.1.4.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| versus-0.1.4-py3-none-any.whl | Python 3 | none | any | Details for versus-0.1.4-py3-none-any.whl |
Total release size: 12.0 kB
Release files / versus-0.1.4.tar.gz
| Download URL | versus-0.1.4.tar.gz |
|---|---|
| Size | 6.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
12afdba56ad510694ba590d0f297249474964db042740bf4f0ac3155081929c9
|
|
BLAKE2b-256 checksum How to use checksums |
1e0b4c4b55709b77e499903c161295c029a4d0c8e5eebc17a39a2150a2ac98a2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.10.12
|
Release files / versus-0.1.4-py3-none-any.whl
| Download URL | versus-0.1.4-py3-none-any.whl |
|---|---|
| Size | 5.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
9d1562e94bcd8b9307d2d6b1ef249e0c6797a49aeaabd179b81734365c4160a3
|
|
BLAKE2b-256 checksum How to use checksums |
c4f3f72cf91ef4d3769b3b5123a1f45f54393beab50fcfc3a3da6682d9a92bc0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.10.12
|
Security for versus 0.1.4
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.