Make comparing version strings super simple.
Project description
verstr
Make comparing version strings super simple.
Quick start
If you want codes using your package to be able to verify its version as easily as:
# user_code.py
import my_package
assert my_package.__version__ >= "1.1"
Just customize your package as follows:
# my_package/__init__.py
import verstr
__version__ = verstr.verstr("1.2.4")
or if you are using a tool such as setuptools_scm
to generate a _version.py
submodule:
# my_package/__init__.py
import verstr
try:
from . import _version
__version__ = verstr.verstr(_version.version)
except ImportError:
__version__ = None
Installation
Install verstr
with pip
pip install verstr
Contributing
You are welcome to help the project, see how.
License
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
verstr-0.1.2.tar.gz
(5.0 kB
view details)
Built Distribution
File details
Details for the file verstr-0.1.2.tar.gz
.
File metadata
- Download URL: verstr-0.1.2.tar.gz
- Upload date:
- Size: 5.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.7.0 importlib_metadata/4.8.2 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 64b47fe4e01778d073796ca76cf8d996a841f15d7c444369e5524f836a5056f7 |
|
MD5 | 260f838523d5f2b705711639b575c5e4 |
|
BLAKE2b-256 | ea4bbe81fb41c66afe9fbf95958ca07f4ffe14634ad5a287509e65d8c9a3f6d4 |
File details
Details for the file verstr-0.1.2-py3-none-any.whl
.
File metadata
- Download URL: verstr-0.1.2-py3-none-any.whl
- Upload date:
- Size: 4.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.7.0 importlib_metadata/4.8.2 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 16c2105f63f3932a867293427f3d150bc954fd17cbe58d9784d0070734319bd9 |
|
MD5 | fa71d1554681ab1efb72d82b9bd09874 |
|
BLAKE2b-256 | 98cb7be0db53ec8b42b65a64f5295d3f23cf18d0ba8ee12daa1557b22384b58d |