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 lint
- 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
main
branch
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
awesomeversion-21.8.1.tar.gz
(9.2 kB
view hashes)
Built Distribution
Close
Hashes for awesomeversion-21.8.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 135011e8c80bedf263a6d1eba7c3ae6774d5a38bf84c27a8fd3f8f257ee2d61d |
|
MD5 | 56518e41e0df5193e7b1958677f044c6 |
|
BLAKE2b-256 | f69c562fe510500e05b3fc26d473c9fe6a0e9b5ca2f03e9ea07eb9da782ac044 |