version-tools
Science Score: 44.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
✓CITATION.cff file
Found CITATION.cff file -
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
○DOI references
-
○Academic publication links
-
○Academic email domains
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (8.2%) to scientific vocabulary
Repository
Basic Info
- Host: GitHub
- Owner: RomoloPoliti-INAF
- Language: Python
- Default Branch: main
- Size: 13.7 KB
Statistics
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
- Releases: 2
Metadata Files
README.md
Version-Tools
Installation
From Repository
To install the Version-Tools package from the repository, run the following commands:
sh
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:
sh
pip install semantic-version-tools
Using poetry
To add the package to your poetry project, you can run the command:
sh
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
```python
from semanticversiontools import Vers
mainver=Vers('1.0') print(mainver)
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
```python
mainversion = Vers((0,1,0,'d',1)) print(mainversion)
Version 0.1.0-devel.1
mainversion = Vers('0.1.0-a.1') print(mainversion)
Version 0.1.0-alpha.1 ```
Compare versions
In the class Vers are implemented the main comparison operators. For example:
```python
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.
```python
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
```python
a = Vers('1.0.0') a += 1.0 a Version 2.0.0 ```
Owner
- Name: Romolo Politi
- Login: RomoloPoliti-INAF
- Kind: user
- Company: INAF
- Repositories: 1
- Profile: https://github.com/RomoloPoliti-INAF
Citation (CITATION.cff)
cff-version: 1.2.0 message: "If you use this software, please cite it as below." authors: - family-names: Politi given-names: Romolo orcid: https://orcid.org/0000-0002-9793-9780 title: Semantic Version Tools version: 1.3.0 date-released: 2025-02-28 doi: 10.5281/zenodo.14943934 url: https://github.com/RomoloPoliti-INAF/version-tools
GitHub Events
Total
- Release event: 2
- Public event: 1
- Push event: 2
- Create event: 1
Last Year
- Release event: 2
- Public event: 1
- Push event: 2
- Create event: 1
Dependencies
- colorama 0.4.6
- exceptiongroup 1.2.2
- iniconfig 2.0.0
- packaging 24.2
- pluggy 1.5.0
- pytest 8.3.4
- setuptools 75.8.0
- tomli 2.2.1
- pytest ^8.3.4 develop
- setuptools (>=75.8.0,<76.0.0)