Skip to main content

Alure Python SDK for licensing and updates

Project description

Alure Python SDK

Official SDK for licensing + updates.

Install (dev)

pip install -e .

Install (PyPI)

pip install alure-sdk

Build and upload:

python -m pip install --upgrade build twine
python -m build
python -m twine upload dist/*

Quickstart (EN)

from alure_sdk import AlureClient

client = AlureClient(base_url="http://localhost:3000/api/v1")
result = client.ensure_active(license_key="YOUR-LICENSE-KEY")

if not result.get("valid"):
    raise SystemExit(f"License invalid: {result.get('reason')}")

modules = result.get("modules") or []
modules_full = result.get("modules_full") or []
print("Modules:", modules or "none")
print("Modules full:", modules_full)

Helpful methods:

  • ensure_active(...): activates if missing, otherwise verifies (online/offline).
  • enabled_modules(): returns active module keys from the stored receipt.
  • verify_online() / verify_offline() for explicit control.
  • quickstart(...): shortcut that returns modules + validation result.
  • check_update_and_download(...): checks updates and downloads the asset.

SDK Guide (EN)

1) Initialize client

from alure_sdk import AlureClient, FileStorage
from pathlib import Path

storage_dir = Path.home() / ".alure-client"
client = AlureClient(
    base_url="http://localhost:3000/api/v1",
    storage=FileStorage(storage_dir),
)

2) Activate or verify

result = client.ensure_active(license_key="ALR-XXXX-YYYY-ZZZZ")
if not result.get("valid"):
    raise RuntimeError(result.get("reason"))

3) Use modules

modules = client.enabled_modules()
if "pro_feature" in modules:
    print("Pro feature enabled")

4) Check updates

update = client.check_update(project_id="PROJECT_ID", channel="stable")
if update.get("update_available"):
    asset = update.get("asset")
    if asset:
        client.download_asset(asset["asset_id"])

5) One-liner (quickstart)

result = client.quickstart(license_key="ALR-XXXX-YYYY-ZZZZ")
print(result.get("modules"))
print(result.get("modules_full"))

Notes:

  • ensure_active() stores/refreshes the receipt automatically.
  • Online verify may return new_receipt; the SDK saves it for you.
  • Use verify_offline(..., verify_signature=True) if you ship the public key.

SDK Python (IT)

SDK ufficiale per licensing + update.

Installazione (dev)

pip install -e .

Installazione (PyPI)

pip install alure-sdk

Build e upload:

python -m pip install --upgrade build twine
python -m build
python -m twine upload dist/*

Uso rapido (IT)

from alure_sdk import AlureClient

client = AlureClient(base_url="http://localhost:3000/api/v1")
result = client.ensure_active(license_key="YOUR-LICENSE-KEY")

if not result.get("valid"):
    raise SystemExit(f"Licenza non valida: {result.get('reason')}")

modules = result.get("modules") or []
modules_full = result.get("modules_full") or []
print("Moduli:", modules or "nessuno")
print("Moduli completi:", modules_full)

Metodi utili:

  • ensure_active(...): attiva se manca, altrimenti verifica (online/offline).
  • enabled_modules(): ritorna le chiavi dei moduli attivi dal receipt.
  • verify_online() / verify_offline() per controllo avanzato.
  • quickstart(...): scorciatoia con moduli + validazione.
  • check_update_and_download(...): verifica update e scarica asset.

Guida SDK (IT)

1) Inizializzare il client

from alure_sdk import AlureClient, FileStorage
from pathlib import Path

storage_dir = Path.home() / ".alure-client"
client = AlureClient(
    base_url="http://localhost:3000/api/v1",
    storage=FileStorage(storage_dir),
)

2) Attivare o verificare

result = client.ensure_active(license_key="ALR-XXXX-YYYY-ZZZZ")
if not result.get("valid"):
    raise RuntimeError(result.get("reason"))

3) Moduli

modules = client.enabled_modules()
if "pro_feature" in modules:
    print("Funzione Pro attiva")

4) Aggiornamenti

update = client.check_update(project_id="PROJECT_ID", channel="stable")
if update.get("update_available"):
    asset = update.get("asset")
    if asset:
        client.download_asset(asset["asset_id"])

5) One-liner (quickstart)

result = client.quickstart(license_key="ALR-XXXX-YYYY-ZZZZ")
print(result.get("modules"))
print(result.get("modules_full"))

Note:

  • ensure_active() salva/aggiorna automaticamente il receipt.
  • La verify online può restituire new_receipt; l'SDK lo salva.
  • Usa verify_offline(..., verify_signature=True) se distribuisci la public key.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

alure_sdk-0.2.0.tar.gz (10.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

alure_sdk-0.2.0-py3-none-any.whl (14.3 kB view details)

Uploaded Python 3

File details

Details for the file alure_sdk-0.2.0.tar.gz.

File metadata

  • Download URL: alure_sdk-0.2.0.tar.gz
  • Upload date:
  • Size: 10.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for alure_sdk-0.2.0.tar.gz
Algorithm Hash digest
SHA256 d6129ad4097ee22c8185f0a739e12568a3f96c146242aa491e0a380208f72981
MD5 26026692385228e4182663200c4fd553
BLAKE2b-256 9eaf918acb2dd59c9662ae715e1b13397e8662e1a6a29a2517e3a8034ca72f72

See more details on using hashes here.

File details

Details for the file alure_sdk-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: alure_sdk-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 14.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for alure_sdk-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f29694aa2a0fef92d6303d79f32612abf186ef3910c5df786f919eea993f6bdc
MD5 acb26cd55e44e28d978e8e6b5d469999
BLAKE2b-256 4a69938eb14f60a4942eafddaa6c02edc3f85c4ec86b558cf6a4fcd89b77b2ab

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page