# maXerial-license-verification-python
A Python package for the communication interface between dockerized Python environments and the maXerial license activation server.
## Usage
```python
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 calling `verify_license()` and `check_feature()`.
### Run the mock server
1. Install Flask:
```bash
python -m pip install Flask
```
2. Start the server (defaults to port 61040; override with `MOCK_SERVER_PORT`):
```bash
python examples/mock_activation_server.py
```
### Run the client example
1. Install the library in editable mode (or `pip install .`):
```bash
python -m pip install -e .
```
2. Optionally set env vars and run:
```bash
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
1. Ensure version is updated in `pyproject.toml` under `[project] version`.
2. (Optional) Create and activate a clean virtual environment.
```bash
python -m venv .venv
source .venv/bin/activate
```
3. Install packaging tools.
```bash
python -m pip install --upgrade pip build twine
```
4. Build the distribution (wheel + sdist).
```bash
python -m build
# Artifacts will be in ./dist/
ls dist/
```
5. Check the distribution files.
```bash
python -m twine check dist/*
```
6. (Recommended) Upload to TestPyPI first.
```bash
# 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/*
```
7. Install from TestPyPI to validate.
```bash
python -m pip install --index-url https://test.pypi.org/simple/ --no-deps maxerial-license-verifier
```
8. Upload to PyPI.
```bash
# 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 `~/.pypirc` for saved credentials and repository aliases.
- If re-uploading the same version, bump the version in `pyproject.toml` (PyPI does not allow overwriting files).
Raw data
{
"_id": null,
"home_page": null,
"name": "maxerial-license-verifier",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": null,
"keywords": "license, activation, verification, maxerial",
"author": null,
"author_email": "maXerial <filip.dobrosavljevic@maxerial.io>",
"download_url": "https://files.pythonhosted.org/packages/8a/14/792831ab0b7ea4bcbced81d9c9fa5520dd5d66ea9cc23820f5f020906bd5/maxerial_license_verifier-0.2.0.tar.gz",
"platform": null,
"description": "# maXerial-license-verification-python\nA Python package for the communication interface between dockerized Python environments and the maXerial license activation server.\n\n## Usage\n\n```python\nfrom maxerial_license_verifier import LicenseVerifier\n\n# Initialize with license file path (Windows style for API calls)\nverifier = LicenseVerifier(\n license_file_path=\"C:\\\\Users\\\\User\\\\Documents\\\\license.xml\",\n server_ip=\"10.0.250.145\", # Optional, defaults to \"127.0.0.1\"\n server_port=61040, # Optional, defaults to 61040\n server_endpoint=\"/api/verify_license\" # Optional, defaults to \"/api/verify_license\"\n)\n\n# Verify license via activation server\nif verifier.verify_license():\n print(\"License verified successfully\")\n \n # Check if a feature is enabled (uses Unix-style path internally)\n if verifier.check_feature(\"pro\"):\n print(\"Pro feature is enabled\")\nelse:\n print(\"License verification failed\")\n```\n\n## Examples\n\nThe `examples/` folder contains small scripts you can run locally. These are not packaged or built with the library.\n\n- `examples/mock_activation_server.py`: Minimal Flask server that accepts the GET request expected by the client for testing purposes.\n- `examples/basic_usage.py`: Demonstrates calling `verify_license()` and `check_feature()`.\n\n### Run the mock server\n\n1. Install Flask:\n ```bash\n python -m pip install Flask\n ```\n2. Start the server (defaults to port 61040; override with `MOCK_SERVER_PORT`):\n ```bash\n python examples/mock_activation_server.py\n ```\n\n### Run the client example\n\n1. Install the library in editable mode (or `pip install .`):\n ```bash\n python -m pip install -e .\n ```\n2. Optionally set env vars and run:\n ```bash\n export EXAMPLE_LICENSE_PATH=C:\\\\Users\\\\User\\\\Documents\\\\license.xml\n export EXAMPLE_FEATURE=feature_name_enabled\n export EXAMPLE_SERVER_IP=127.0.0.1\n export EXAMPLE_SERVER_PORT=61040\n python examples/basic_usage.py\n ```\n\nThe 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.\n\n## Build and publish to PyPI\n\n1. Ensure version is updated in `pyproject.toml` under `[project] version`.\n2. (Optional) Create and activate a clean virtual environment.\n ```bash\n python -m venv .venv\n source .venv/bin/activate\n ```\n3. Install packaging tools.\n ```bash\n python -m pip install --upgrade pip build twine\n ```\n4. Build the distribution (wheel + sdist).\n ```bash\n python -m build\n # Artifacts will be in ./dist/\n ls dist/\n ```\n5. Check the distribution files.\n ```bash\n python -m twine check dist/*\n ```\n6. (Recommended) Upload to TestPyPI first.\n ```bash\n # Create a token at https://test.pypi.org/manage/account/#api-tokens\n # Username: __token__\n # Password: pypi-AgENdGVzdC5weXBpLm9yZw... (your token)\n python -m twine upload --repository-url https://test.pypi.org/legacy/ dist/*\n ```\n7. Install from TestPyPI to validate.\n ```bash\n python -m pip install --index-url https://test.pypi.org/simple/ --no-deps maxerial-license-verifier\n ```\n8. Upload to PyPI.\n ```bash\n # Create a token at https://pypi.org/manage/account/#api-tokens\n # Username: __token__\n # Password: pypi-AgENdHB5cGkub3Jn... (your token)\n python -m twine upload dist/*\n ```\n\nTips:\n- Consider tagging the release: `git tag v0.1.0 && git push origin v0.1.0`.\n- You can configure `~/.pypirc` for saved credentials and repository aliases.\n- If re-uploading the same version, bump the version in `pyproject.toml` (PyPI does not allow overwriting files).\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Client library to verify maXerial licenses via a local activation server and check licensed features.",
"version": "0.2.0",
"project_urls": {
"Homepage": "https://pypi.org/project/maxerial-license-verifier/",
"Source": "https://github.com/maxerial/maxerial-license-verifier"
},
"split_keywords": [
"license",
" activation",
" verification",
" maxerial"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "138e0fd9776bb276b84433fe047bc36153524934e1f01c304ffc4952d35a9f57",
"md5": "4a8179d77c2d3887ce05d2facc8e31f4",
"sha256": "f3a607d8d0bc057438a56f48e0f44363ab839acb1cd1e12861fd1a51e33a6f8a"
},
"downloads": -1,
"filename": "maxerial_license_verifier-0.2.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "4a8179d77c2d3887ce05d2facc8e31f4",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 5060,
"upload_time": "2025-09-10T11:37:33",
"upload_time_iso_8601": "2025-09-10T11:37:33.263485Z",
"url": "https://files.pythonhosted.org/packages/13/8e/0fd9776bb276b84433fe047bc36153524934e1f01c304ffc4952d35a9f57/maxerial_license_verifier-0.2.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "8a14792831ab0b7ea4bcbced81d9c9fa5520dd5d66ea9cc23820f5f020906bd5",
"md5": "b8da3aeb9742c77c5bdc37ee490b38a3",
"sha256": "da3316f4145461a42c46c6dd0687cb080ea1612c9729af9875f5ecb6bd3d5452"
},
"downloads": -1,
"filename": "maxerial_license_verifier-0.2.0.tar.gz",
"has_sig": false,
"md5_digest": "b8da3aeb9742c77c5bdc37ee490b38a3",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 4693,
"upload_time": "2025-09-10T11:37:34",
"upload_time_iso_8601": "2025-09-10T11:37:34.720803Z",
"url": "https://files.pythonhosted.org/packages/8a/14/792831ab0b7ea4bcbced81d9c9fa5520dd5d66ea9cc23820f5f020906bd5/maxerial_license_verifier-0.2.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-09-10 11:37:34",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "maxerial",
"github_project": "maxerial-license-verifier",
"github_not_found": true,
"lcname": "maxerial-license-verifier"
}