Skip to main content

Version-Tools

Installation

From Repository

To install the Version-Tools package from the repository, run the following commands:

git clone https://github.com/RomoloPoliti-INAF/version-tools.git
cd version-tools
poetry install

From PyPi

To install the Version-Tools package from PyPi, run the following command:

pip install semantic-version-tools

Using poetry

To add the package to your poetry project, you can run the command:

poetry add semantic-versioning-tools

Usage

To use the library it's necessary import the class Vers, than you can comapare or manipulate the version numbers.

Initialize and print version

>>> from semantic_version_tools import Vers

>>> main_ver=Vers('1.0')
>>> print(main_ver)

Version 1.0

The version number could be a string or a tuple, whit 2 or 5 elements:

  • the major version number
  • the minor version number
  • the patch number
  • pre-release type
  • build number

For the pre-release are used letters as reported below:

  • d: developing version
  • a: alpha release
  • b: beta release
  • rc: release candidate
  • f: final release
>>> main_version = Vers((0,1,0,'d',1))
>>> print(main_version)

Version 0.1.0-devel.1

>>> main_version = Vers('0.1.0-a.1')
>>> print(main_version)

Version 0.1.0-alpha.1

Compare versions

In the class Vers are implemented the main comparison operators. For example:

>>> a=Vers('1.0.0')
>>> b=Vers('1.0.1')

>>> a>b
False
>>> a==b
False
>>> a<b
True
a<=b
True

Sum and increase

It's possible sum tro version number or icrease it.

>>> a = Vers('1.0.0')
>>> b = Vers('1.0.1')
>>> c=a+b
>>> c
Version 2.0.1


>>> a = Vers('1.0.0')
>>> a=a+1
>>> a
Version 1.1.0
# equivalent to
>>> a +=1
>>> a
Version 1.1.0

The summ add a minor version. To add a major version you must add a float

>>> a = Vers('1.0.0')
>>> a += 1.0
>>> a
Version 2.0.0

Metadata

Release files for semantic-version-tools 1.4.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for semantic-version-tools 1.4.1
File Size Uploaded Provenance
semantic_version_tools-1.4.1.tar.gz 3.0 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for semantic-version-tools 1.4.1
File Interpreter ABI Platform
semantic_version_tools-1.4.1-py3-none-any.whl Python 3 none any Details

Total release size: 6.8 kB

Release files / semantic_version_tools-1.4.1.tar.gz

Download URL semantic_version_tools-1.4.1.tar.gz
Size 3.0 kB
Tags Source
SHA-256 checksum
How to use checksums
301c072a1942cdc96cf2ac8cfffaa398992765b63168140c7d7f119b74e2e231
BLAKE2b-256 checksum
How to use checksums
cac86940184c1d2bad1de17fdad56563505b37bac0560c41c3229baf55633094
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.3.1 CPython/3.14.2 Linux/6.18.5-200.fc43.x86_64

Release files / semantic_version_tools-1.4.1-py3-none-any.whl

Download URL semantic_version_tools-1.4.1-py3-none-any.whl
Size 3.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
02e3806f3ccb213698f011799c1fded2fa20b7f5fb680e529829090a0d3b940b
BLAKE2b-256 checksum
How to use checksums
ee9dccf2a6da81417385ebff5ab2eddc82a5af5e37a0a7ba7250f980397909b3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.3.1 CPython/3.14.2 Linux/6.18.5-200.fc43.x86_64

Security for semantic-version-tools 1.4.1

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.

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