CheckVersions is a powerful and intuitive version comparison tool for software development.
Project description
CheckVersions is a powerful and intuitive version comparison tool designed to simplify the process of discerning the latest and older versions in software development.
Features
-
Semantic Version Analysis: 🧐 Leverage our sophisticated semantic versioning analysis engine to compare versions like "0.0.0-beta" effortlessly.
-
Automated Version Ranking: 🚀 CheckVersions automatically ranks versions based on their priority, allowing you to quickly identify the latest version.
-
Efficient Version Delta Assessment: 📊 CheckVersions provides a simple and efficient way to assess the difference between two versions.
-
User-Friendly Interface: 🎨 Our intuitive user interface ensures that developers can effortlessly compare versions.
-
Secure Version Analysis: 🔒 Security is paramount. CheckVersions ensures version comparison is performed securely, protecting your intellectual property and facilitating risk-free decision-making in your development process.
-
Custom Hierarchy 📝 Customize the hierarchy of version words to suit your needs. For instance, you can assign a higher priority to "beta" than "alpha" if you wish.
-
Older Version Retrieval: ⏳ Optionally retrieve the older version when comparing two versions by setting the
older_version
parameter toTrue
.
Getting Started
Installation
pip install checkversions
Usage
from checkversions import *
# Example 1: Basic Version Comparison
current_version = "v1.0.0"
latest_version = "v1.0.0-beta"
result = compare_versions(current_version, latest_version)
print(result)
# Output: v1.0.0
In this example, we demonstrate a basic version comparison. The compare_versions function is used to compare the current_version (v1.0.0) with the latest_version (v1.0.0-beta). The result is printed, and it shows that the latest version is v1.0.0.
from checkversions import *
# Example 2: Comparing Versions with Hyphens and Words
version1 = "2.0.0-beta"
version2 = "2.0.1-alpha"
result = compare_versions(version1, version2)
print(result)
# Output: 2.0.1-alpha
In this example, we showcase version comparison with hyphens and additional words. The compare_versions function compares version1 (2.0.0-beta) with version2 (2.0.1-alpha). The result is printed, indicating that the latest version is 2.0.1-alpha.
Default Hierarchy
{
"beta": 0,
"prerelease": 1,
"alpha": 2,
"unstable": 3,
"stable": 4,
"release": 5
}
The default hierarchy is a JSON representation that assigns priority values to version words. For instance, "beta" has a priority of 0, "prerelease" has a priority of 1, and so on.
Custom Hierarchy
from checkversions import *
# Example 3: Custom Hierarchy
# Define a custom hierarchy
custom_hierarchy = {"beta": 0, "alpha": 1, "rc": 2, "gamma": 3, "stable": 4}
version1 = "v1.0.0-beta"
version2 = "v1.0.1-alpha"
result = compare_versions(version1, version2, custom_hierarchy)
print(result)
# Output: v1.0.1-alpha
In this example, we introduce a custom hierarchy for version comparison. The custom_hierarchy dictionary is defined with version words and their corresponding priority. The compare_versions function uses this custom hierarchy to compare version1 (v1.0.0-beta) with version2 (v1.0.1-alpha). The result is printed, indicating that the latest version is v1.0.1-alpha.
Older Version
from checkversions import *
current_version = "v1.0.0"
latest_version = "v1.0.0-beta"
# Example with older_version=True
result_older = compare_versions(current_version, latest_version, older_version=True)
print(f"Older version: {result_older}")
# Output: Older version: v1.0.0-beta
In this example, by setting older_version=True, the function returns and prints the older version (v1.0.0-beta) based on the provided versions (v1.0.0 and v1.0.0-beta). If older_version is omitted or set to False, it would return and print the latest version.
Contributing
Contributions are welcome! Before contributing, please read our Contributing Guidelines to ensure a smooth and collaborative development process.
Code of Conduct
Please review our Code of Conduct to understand the standards of behavior we expect from contributors and users of this project.
License
This project is licensed under the MIT License. See LICENSE for more details.
Support the Project
Happy Coding ❤️
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file checkversions-0.0.5.tar.gz
.
File metadata
- Download URL: checkversions-0.0.5.tar.gz
- Upload date:
- Size: 8.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.18
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e09323bf09c043bf8f765032a277295a5f7ccfd561767c77cffa117b646b9995 |
|
MD5 | bfc999402209bc8b094ba25d564355b8 |
|
BLAKE2b-256 | 8cf37042f5820c28c2aa72fd769030cbfadd446e888cf040f105d7f789080f05 |