"""
Inscoper NBO Example Script: Get Version
========================================
This script demonstrates how to retrieve the version of the NBO library and how
to compare it with the version of the Python package.

Prerequisites:
-------------
1. Installation: The `inscoper_nbo` wheel must be installed in the active Python
   environment.
"""

# --8<-- [start:main_logic]
import inscoper_nbo

# Version of the Python wheel, exposed as a standard dunder attribute
package_version = inscoper_nbo.__version__
print(f"Package version: {package_version}")

# Identification string of the native library the wheel is built on
library_version = inscoper_nbo.NBOUtils.getVersion()
print(f"Library version: {library_version}")

# The package version is always contained in the library identification string,
# which makes the check below a reliable installation test
major, minor, patch = package_version.split(".")
assert f" v{major}.{minor}.{patch}" in library_version
# --8<-- [end:main_logic]
