Skip to main content

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

MIT

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

verstr-0.1.2.tar.gz (5.0 kB view hashes)

Uploaded Source

Built Distribution

verstr-0.1.2-py3-none-any.whl (4.0 kB view hashes)

Uploaded Python 3

Supported by

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