Skip to main content

Sort versions according to different versioning schemas

Project description

VerSort

License PyPI - Python Version PyPI CI codecov

Sort versions according to different versioning schemas.

Install

To use as a CLI app:

pipx install versort

To use as a library:

pip install versort

Usage

Supported version algorithms

As a library

from versort import get_sorter

sorter = get_sorter("pep440")()
print(sorter.sort("v1", "2a1", "2"))

CLI

You can call versort directly, or as a Python module with python -m versort.

 echo 2 2a1 v1 | versort --stdin pep440
v1
2a1
2 versort --reverse pep440 2 2a1 v1
2
2a1
v1

➤ versort --first pep440 2 2a1 v1
v1

➤ python -m versort --reverse --first pep440 2 2a1 v1
2

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

versort-0.1.1.tar.gz (5.2 kB view hashes)

Uploaded Source

Built Distribution

versort-0.1.1-py3-none-any.whl (6.7 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