Client library to verify maXerial licenses via a local activation server and check licensed features.
Project description
maXerial-license-verification-python
A Python package for the communication interface between dockerized Python environments and the maXerial license activation server.
Usage
from maxerial_license_verifier import LicenseVerifier
# Initialize with license file path (Windows style for API calls)
verifier = LicenseVerifier(
license_file_path="C:\\Users\\User\\Documents\\license.xml",
server_ip="10.0.250.145", # Optional, defaults to "127.0.0.1"
server_port=61040, # Optional, defaults to 61040
server_endpoint="/api/verify_license" # Optional, defaults to "/api/verify_license"
)
# Verify license via activation server
if verifier.verify_license():
print("License verified successfully")
# Check if a feature is enabled (uses Unix-style path internally)
if verifier.check_feature("pro"):
print("Pro feature is enabled")
else:
print("License verification failed")
Examples
The examples/ folder contains small scripts you can run locally. These are not packaged or built with the library.
examples/mock_activation_server.py: Minimal Flask server that accepts the GET request expected by the client for testing purposes.examples/basic_usage.py: Demonstrates callingverify_license()andcheck_feature().
Run the mock server
- Install Flask:
python -m pip install Flask
- Start the server (defaults to port 61040; override with
MOCK_SERVER_PORT):python examples/mock_activation_server.py
Run the client example
- Install the library in editable mode (or
pip install .):python -m pip install -e .
- Optionally set env vars and run:
export EXAMPLE_LICENSE_PATH=C:\\Users\\User\\Documents\\license.xml export EXAMPLE_FEATURE=feature_name_enabled export EXAMPLE_SERVER_IP=127.0.0.1 export EXAMPLE_SERVER_PORT=61040 python examples/basic_usage.py
The example prints the result of verify_license() and whether a feature is present in the XML. Ensure your license XML contains a <feature> entry matching EXAMPLE_FEATURE for a True result.
Build and publish to PyPI
- Ensure version is updated in
pyproject.tomlunder[project] version. - (Optional) Create and activate a clean virtual environment.
python -m venv .venv source .venv/bin/activate
- Install packaging tools.
python -m pip install --upgrade pip build twine
- Build the distribution (wheel + sdist).
python -m build # Artifacts will be in ./dist/ ls dist/
- Check the distribution files.
python -m twine check dist/*
- (Recommended) Upload to TestPyPI first.
# Create a token at https://test.pypi.org/manage/account/#api-tokens # Username: __token__ # Password: pypi-AgENdGVzdC5weXBpLm9yZw... (your token) python -m twine upload --repository-url https://test.pypi.org/legacy/ dist/*
- Install from TestPyPI to validate.
python -m pip install --index-url https://test.pypi.org/simple/ --no-deps maxerial-license-verifier
- Upload to PyPI.
# Create a token at https://pypi.org/manage/account/#api-tokens # Username: __token__ # Password: pypi-AgENdHB5cGkub3Jn... (your token) python -m twine upload dist/*
Tips:
- Consider tagging the release:
git tag v0.1.0 && git push origin v0.1.0. - You can configure
~/.pypircfor saved credentials and repository aliases. - If re-uploading the same version, bump the version in
pyproject.toml(PyPI does not allow overwriting files).
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file maxerial_license_verifier-0.3.0.tar.gz.
File metadata
- Download URL: maxerial_license_verifier-0.3.0.tar.gz
- Upload date:
- Size: 4.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a80afc0b6e32d563db9e7fdfbc3f4f4d9d28e497e8cb4875b9f27efc6b5ccdeb
|
|
| MD5 |
4633af176caafb098dbf5ec94f4f8827
|
|
| BLAKE2b-256 |
f46230c45c0dbd7f124a92728cd0f5b1496d81be85e16aeef539fd0f6381cf16
|
File details
Details for the file maxerial_license_verifier-0.3.0-py3-none-any.whl.
File metadata
- Download URL: maxerial_license_verifier-0.3.0-py3-none-any.whl
- Upload date:
- Size: 4.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a40459f6389d5f08021cb78340d5f515e3563638fc972ab64f10a59a6bcf3634
|
|
| MD5 |
ec2562a0a2e16c97adfd2d31075445e0
|
|
| BLAKE2b-256 |
66cce71acc1ed5a13ee412aa63c4a50916757be5c820b1f84f8c068b8d7be692
|