The Python binding is pure ctypes over the core library, so there is no compiler involved at install time and no wheel to build per interpreter version.
pip install keynub-licdongleCode language: Bash (bash)
Reading a license
from keynub import Dongle
with Dongle.open() as dongle: # first dongle found
if not dongle.is_genuine:
raise SystemExit("no genuine KeyNub found")
dongle.session_open()
license = dongle.record_read("license")Code language: Python (python)
Python needs this more than most languages
Python ships as source, or as a bundle a determined person can unpack. PyInstaller, Nuitka and cx_Freeze raise the effort a little, but .pyc files decompile well and a licence check written as an if is a one-line patch. This is not a reason to avoid Python; it is a reason to put the dongle somewhere that patching cannot reach:
# Weak -- delete one line and it is gone.
if dongle.is_genuine:
enable_feature()
# Strong -- the model, table or key only decrypts with the dongle present.
weights = dongle.app_decrypt(encrypted_blob_shipped_with_your_installer)Code language: Python (python)
For scientific and engineering software this is usually easy, because there is almost always a calibration table, a coefficient set, a trained model or a protocol key that the program cannot invent for itself.
Running your test suite without hardware
The SDK includes an in-process software dongle that speaks the real protocol, so CI can exercise the whole flow — authentication, session, records, app-crypto — on a build server with nothing plugged in. Your tests do not have to skip the licensing path.