Package: checkversions
CheckVersionsCheckVersions is a powerful and intuitive version comparison tool designed to simplify the process of discerning the latest and older versions in software development.FeaturesSemantic 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 theolder_versionparameter toTrue.Getting StartedInstallationpipinstallcheckversionsUsagefromcheckversionsimport*# Example 1: Basic Version Comparisoncurrent_version="v1.0.0"latest_version="v1.0.0-beta"result=compare_versions(current_version,latest_version)print(result)# Output: v1.0.0In 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.fromcheckversionsimport*# Example 2: Comparing Versions with Hyphens and Wordsversion1="2.0.0-beta"version2="2.0.1-alpha"result=compare_versions(version1,version2)print(result)# Output: 2.0.1-alphaIn 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 Hierarchyfromcheckversionsimport*# Example 3: Custom Hierarchy# Define a custom hierarchycustom_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-alphaIn 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 Versionfromcheckversionsimport*current_version="v1.0.0"latest_version="v1.0.0-beta"# Example with older_version=Trueresult_older=compare_versions(current_version,latest_version,older_version=True)print(f"Older version:{result_older}")# Output: Older version: v1.0.0-betaIn 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.ContributingContributions are welcome! Before contributing, please read ourContributing Guidelinesto ensure a smooth and collaborative development process.Code of ConductPlease review ourCode of Conductto understand the standards of behavior we expect from contributors and users of this project.LicenseThis project is licensed under theMIT License. SeeLICENSEfor more details.Support the Project💰 You can help me improve more by offering a little support on any platform❤️Happy Coding ❤️