Skip to main content
Versionix logo Latest PyPI version Supported Python versions CI status Coverage Codacy grade License

Versionix is a lightweight Python tool that retrieves and displays the version of any standalone software — handling the many different version output formats found in the wild.

Source:

github.com/sequana/versionix

Issues:

github.com/sequana/versionix/issues

Changelog:

See the Changelog section below


Overview

Many standalone tools expose their version in different ways:

  • Some require --version, some -v, and some no argument at all.

  • Some write to stdout, others to stderr.

  • Version strings come in many formats (1.2.3, v1.2.3, tool 1.2.3 (build ...), …).

Versionix handles all of these cases automatically. For ~80 % of tools the built-in regular-expression heuristic is enough; for the rest a curated registry of metadata ensures the right command is run and the right output channel is parsed.

Key features

  • 🔍 Auto-detection — works out-of-the-box for the vast majority of tools

  • 📋 Registry — curated metadata for tools with non-standard version output

  • 🐍 Pure Python — no compiled dependencies; works on any platform

  • ⚡ Fast — single subprocess call, minimal overhead

  • 🔗 Library API — importable get_version() function for use in your own code

  • 📦 Container support — introspect versions from local Singularity/Apptainer image files

Installation

Install from PyPI with pip:

pip install versionix --upgrade

No extra dependencies are required beyond the Python standard library and a handful of small pure-Python packages.

Usage

Command line

Just type versionix followed by the name of any executable on your $PATH:

versionix ls          # any system command
versionix fastqc      # common bioinformatics tool
versionix bwa

versionix prints a clean X.Y.Z version string to the terminal.

List all registered tools:

versionix --registered

Full help:

versionix --help
versionix --help output

Container introspection

You can retrieve the version of a tool that is packaged inside a local Singularity/Apptainer image file (.img or .sif) using the --from option:

versionix sniffles --from sniffles_2.7.3.img
versionix fastqc --from fastqc.sif

If apptainer is available it is preferred over singularity; both are tried automatically.

Python API

You can also call get_version directly from Python:

from versionix import get_version

version = get_version("fastqc")
print(version)  # e.g. "0.11.9"

Pass a container argument to introspect a tool inside a local image file:

from versionix import get_version

version = get_version("sniffles", container="sniffles_2.7.3.img")

How it works

The first difficulty is that standalone applications have different ways to obtain their version information. Some require the use of a long or short argument (--version or -v), while others do not require any argument at all. In addition, the display channel (stdout or stderr) and the format of the version output differ between applications.

To handle these various cases, Versionix uses a regular expression that covers the majority of applications. For non-standard cases, a dictionary of metadata for each registered standalone is available. These metadata specify:

  • the command and options to run,

  • whether to read stdout or stderr, and

  • how to parse the output to extract the version string.

Versionix is designed to be used with all Sequana pipelines and is not intended to be universal. You can add support for your own tool by editing versionix/registry.py and opening a Pull Request.

Contributing

Contributions are very welcome! Please:

  1. Fork the repository and create a feature branch.

  2. Add or update tests as appropriate.

  3. Open a Pull Request against main.

Run the test suite locally with:

pytest -v --cov versionix

Changelog

Version

Description

0.99.5

run subprocess with a time limit. add bwa and ktImport* in registry

0.99.4

allow introspection of apptainers, cleanup, more tests

0.99.3

Maintenance release

0.99.2

Handle cases where e.g. –version is returned to the stderr (instead of stdout)

0.99.1

Remove warning if we are using registered entry.

0.99.0

Final version before 1.0.0

0.3.0

Refactor to use regular expression and registry only if needed. This makes versionix quite generic.

0.2.4

More tools in the registry and added precommit

0.2.3

More tools in the registry

0.2.2

add all tools required by sequana pipelines (oct 2023)

0.2.1

More tools added.

0.2

simplification. Add tests. Add more tools

0.1

first draft

Metadata

Release files for versionix 0.99.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for versionix 0.99.5
File Size Uploaded
versionix-0.99.5.tar.gz 11.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for versionix 0.99.5
File Interpreter ABI Platform
versionix-0.99.5-py3-none-any.whl Python 3 none any Details

Total release size: 23.7 kB

Release files / versionix-0.99.5.tar.gz

Download URL versionix-0.99.5.tar.gz
Size 11.6 kB
Tags Source
SHA-256 checksum
How to use checksums
14413939afd1ce19c903ab16ad581144d4a0ab75aaad16100b47cb4e709d9361
BLAKE2b-256 checksum
How to use checksums
be9b89ecea928d4d128a7e4534fbf21408e362d9bb9934bcff6664799cce18ae
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.0.1 CPython/3.10.14 Linux/6.14.5-100.fc40.x86_64

Release files / versionix-0.99.5-py3-none-any.whl

Download URL versionix-0.99.5-py3-none-any.whl
Size 12.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ae71129e41ff996bee1e9532f4549e31238e3d173103bd8754b01315448a37a6
BLAKE2b-256 checksum
How to use checksums
9b5e9690aa30dd65f727c73543ad8c20d2a8c05803126135ccc6ad5e9a3734cf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.0.1 CPython/3.10.14 Linux/6.14.5-100.fc40.x86_64

Release history Release notifications | RSS feed

This release

0.99.5 This release

2 release files

0.99.4

2 release files

0.99.1

2 release files

0.3.0

2 release files

0.2.4

2 release files

0.2.3

2 release files

0.2.2

1 release file

0.2.1

2 release files

0.2.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page