Skip to main content

DistroMate License Verification SDK for Python

Project description

dm-api-python

Python SDK for DistroMate dm_api native library.

Install

pip install distromate-dm-api

Quick Start (License)

from dm_api import DmApi

api = DmApi()

api.set_product_data("<product-data>")
api.set_product_id("your-product-id")
api.set_license_key("XXXX-XXXX-XXXX")

if not api.activate_license():
    raise RuntimeError(api.get_last_error() or "activation failed")

if not api.is_license_genuine():
    code = api.get_last_activation_error()
    name = api.get_activation_error_name(code)
    raise RuntimeError(f"license check failed: {name}, err={api.get_last_error()}")

API Groups

  • License setup: set_product_data, set_product_id, set_data_directory, set_debug_mode, set_custom_device_fingerprint
  • License activation: set_license_key, set_license_callback, activate_license, get_last_activation_error
  • License state: is_license_genuine, is_license_valid, get_server_sync_grace_period_expiry_date, get_activation_mode
  • License details: get_license_key, get_license_expiry_date, get_license_creation_date, get_license_activation_date, get_activation_creation_date, get_activation_last_synced_date, get_activation_id
  • Update: check_for_updates, download_update, cancel_update_download, get_update_state, get_post_update_info, ack_post_update_info, wait_for_update_state_change, quit_and_install
  • General: get_library_version, json_to_canonical, get_last_error, reset

Update API Notes

  • Update APIs return parsed JSON envelope (dict) when transport succeeds.
  • If native API returns NULL, Python SDK returns None; check get_last_error().
  • quit_and_install() returns native int status code directly:
    • 1: accepted, process should exit soon
    • -1: business-level rejection (check get_last_error())
    • -2: transport/parse error

Environment Variables

  • DM_API_PATH: optional path to native library
  • DM_APP_ID, DM_PUBLIC_KEY: optional defaults for app identity
  • DM_LAUNCHER_ENDPOINT, DM_LAUNCHER_TOKEN: launcher IPC variables used by update APIs

Release

  • CI workflow validates package build.
  • Tag v* triggers publish workflow to PyPI.
  • Required secret: PYPI_API_TOKEN.

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

distromate_dm_api-1.2.0.tar.gz (7.2 kB view details)

Uploaded Source

Built Distribution

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

distromate_dm_api-1.2.0-py3-none-any.whl (8.5 kB view details)

Uploaded Python 3

File details

Details for the file distromate_dm_api-1.2.0.tar.gz.

File metadata

  • Download URL: distromate_dm_api-1.2.0.tar.gz
  • Upload date:
  • Size: 7.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for distromate_dm_api-1.2.0.tar.gz
Algorithm Hash digest
SHA256 c3f73c8ec249fe162ecd756180c77371f7dc77fa3cd5471d6ce387a711483a29
MD5 2386135812c3897bad7288e4c7aa76c8
BLAKE2b-256 d1a740e2413373ad8f8bbea7acdbc6ab27ddf9fa5c16ca3df0b16ed6737a9c02

See more details on using hashes here.

File details

Details for the file distromate_dm_api-1.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for distromate_dm_api-1.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ba4439390a705da15da038edfc7e1d28a0010100e5e7906420a17fabbcaf9a0e
MD5 dd9e9d3ccfdef4479e6b5485c3bf0b59
BLAKE2b-256 b671726555b280d7f2f52c27fe232f94ca1fb2d4cfdcee32b138cf688e56e5f5

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