One version package to rule them all, One version package to find them, One version package to bring them all, and in the darkness bind them.
Project description
AwesomeVersion
One version package to rule them all, One version package to find them, One version package to bring them all, and in the darkness bind them.
Make anything a version object, and compare against a vast section of other version formats.
Installation
python3 -m pip install awesomeversion
Example usage
These are some examples of what you can do, more examples can be found in the tests directory.
from awesomeversion import AwesomeVersion
current = AwesomeVersion("1.2.2")
upstream = AwesomeVersion("1.2.3")
print(upstream > current)
> True
from awesomeversion import AwesomeVersion
version = AwesomeVersion("1.2.3b0")
print(version.beta)
> True
from awesomeversion import AwesomeVersion
current = AwesomeVersion("2021.1.0")
upstream = AwesomeVersion("2021.1.0b2")
print(upstream > current)
> False
from awesomeversion import AwesomeVersion
current = AwesomeVersion("latest")
upstream = AwesomeVersion("2021.1.0")
print(upstream > current)
> False
from awesomeversion import AwesomeVersion
current = AwesomeVersion("latest")
upstream = AwesomeVersion("dev")
print(upstream > current)
> True
from awesomeversion import AwesomeVersion
with AwesomeVersion("20.12.0") as current:
with AwesomeVersion("20.12.1") as upstream:
print(upstream > current)
> True
from awesomeversion import AwesomeVersion
with AwesomeVersion("20.12.0") as current:
print("2020.12.1" > current)
> True
Contribute
All contributions are welcome!
- Fork the repository
- Clone the repository locally and open the devcontainer or use GitHub codespaces
- Do your changes
- Lint the files with
make black - Ensure all tests passes with
make test - Ensure 100% coverage with
make coverage - Commit your work, and push it to GitHub
- Create a PR against the
mainbranch
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file awesomeversion-21.1.7.tar.gz.
File metadata
- Download URL: awesomeversion-21.1.7.tar.gz
- Upload date:
- Size: 7.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.9.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ae9b3fe226f7d006dfc1322e35236aaa0a3f559fcfbb37c068ab39299f2c1dd4
|
|
| MD5 |
d80b2c8449082a99fb31baa972402cd4
|
|
| BLAKE2b-256 |
d7dd4c1de66700ec2898296933d7a342f6c1dd5c48cd80435891800e27ee9629
|
File details
Details for the file awesomeversion-21.1.7-py3-none-any.whl.
File metadata
- Download URL: awesomeversion-21.1.7-py3-none-any.whl
- Upload date:
- Size: 10.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.9.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e989b58e5c8734d798a7af69573539c9f4787e8ecc531a045a10936501733fcb
|
|
| MD5 |
aa334935c7728c9f23a0b34ae0ebb430
|
|
| BLAKE2b-256 |
8c9a5350ba4d94d00d44f4444fd9caad7ec6ca0aaced908467f3968740fb10fb
|