Skip to main content

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

codecov python version dependencies PyPI Actions

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!

  1. Fork the repository
  2. Clone the repository locally and open the devcontainer or use GitHub codespaces
  3. Do your changes
  4. Lint the files with make lint
  5. Ensure all tests passes with make test
  6. Ensure 100% coverage with make coverage
  7. Commit your work, and push it to GitHub
  8. Create a PR against the main branch

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

awesomeversion-21.11.0.tar.gz (10.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

awesomeversion-21.11.0-py3-none-any.whl (13.4 kB view details)

Uploaded Python 3

File details

Details for the file awesomeversion-21.11.0.tar.gz.

File metadata

  • Download URL: awesomeversion-21.11.0.tar.gz
  • Upload date:
  • Size: 10.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.10.0

File hashes

Hashes for awesomeversion-21.11.0.tar.gz
Algorithm Hash digest
SHA256 ef8f7bb458a6dd16ec95e28553df3b6c556de8bc93fb13f142eb95a357cfc3a0
MD5 a7f26875b6089924c9a4c59ac38a4168
BLAKE2b-256 f0ab22fb70523819992c2d912c77538b4b40737028d826ea84bbc852a8c1138d

See more details on using hashes here.

File details

Details for the file awesomeversion-21.11.0-py3-none-any.whl.

File metadata

  • Download URL: awesomeversion-21.11.0-py3-none-any.whl
  • Upload date:
  • Size: 13.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.10.0

File hashes

Hashes for awesomeversion-21.11.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2e8b9e2ce3cdced7d0ec5c6ee580c5be170880f012c4dc2132ac827bf7f96f70
MD5 64f5ee762b34f24136be88dcb3315e8a
BLAKE2b-256 f672fea4ab68ddf8f6018cdef5312a46b86aff874fa340b68d3400a8246be7a7

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page