Typed Python SDK for the LicenseKit licensing API
Project description
licensekit-sdk
First-party Python SDK for licensekit.dev.
This package exposes Management, Runtime, and System clients over the LicenseKit licensing API at https://api.licensekit.dev, including reporting and frozen export operations, along with least-privilege scope metadata and Ed25519 runtime-signature verification helpers for activation, validation, metering, and offline-aware license flows.
Why use it
- Typed
ManagementClient,RuntimeClient, andSystemClientsurfaces. - Runtime signature verification helpers backed by
PyNaCl. - Least-privilege scope discovery derived from the OpenAPI contract.
- Hosted and self-hosted support through a configurable
base_url.
Links:
Install
pip install licensekit-sdk
Quick Start
from licensekit import (
ManagementClient,
PublicKeyStore,
RuntimeClient,
SystemClient,
verify_runtime_result,
)
base_url = "https://api.licensekit.dev"
system = SystemClient(base_url=base_url)
health = system.health()
print(health["data"]["status"])
management = ManagementClient(
base_url=base_url,
token="lkm_..."
)
product = management.create_product(
body={
"name": "Example App",
"code": "example-app",
}
)
runtime = RuntimeClient(
base_url=base_url,
license_key="lsk_..."
)
result = runtime.validate_license(
body={
"fingerprint": "host-123",
}
)
public_keys = system.list_public_keys()
verified = verify_runtime_result(
result,
PublicKeyStore(public_keys["data"]),
)
print(product["data"]["id"], verified.ok)
Package Shape
ManagementClientUsesAuthorization: Bearer <token>for/api/v1/...management operations, including/api/v1/activitiesand/api/v1/reports/....RuntimeClientUsesAuthorization: License <license-key>for/api/v1/license/...runtime operations.SystemClientUnauthenticated access to/health,/healthz,/readyz,/metrics, and/api/v1/system/public-keys.
Hosted deployments should prefer /health for liveness checks behind api.licensekit.dev.
/healthz remains available for local and self-hosted compatibility.
Scope Metadata
from licensekit import get_required_scopes, has_required_scopes
scopes = get_required_scopes("createProduct")
allowed = has_required_scopes("createProduct", ["product:write"])
Raw Response Access
Each client exposes a .raw companion for callers that need status codes and headers.
from licensekit import SystemClient
system = SystemClient(base_url="https://api.licensekit.dev")
ready = system.raw.readyz()
print(ready.status, ready.data["data"]["status"])
management.download_report_export() returns raw bytes so JSON, CSV, and PDF report snapshots can be handled without assuming a single response shape. Use management.raw.download_report_export() when you also need the response headers to branch on Content-Type.
Development
python3 -m venv .venv
source .venv/bin/activate
pip install -e '.[dev]'
python scripts/generate_from_openapi.py
pytest
python -m build
python -m twine check dist/*
Generation uses the checked-in OpenAPI snapshot at openapi/openapi.yaml.
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 licensekit_sdk-1.0.0.tar.gz.
File metadata
- Download URL: licensekit_sdk-1.0.0.tar.gz
- Upload date:
- Size: 28.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2f94261e6d48450fbec8f20a40752d4612570a7d0e90e3587790bdf723c922b4
|
|
| MD5 |
72f66a83b3172ed3c814d264b457ca81
|
|
| BLAKE2b-256 |
1611e2722e5cee891c8c4a9546bdf769c13ecb5bc50d3b42de81fd4617d9803b
|
Provenance
The following attestation bundles were made for licensekit_sdk-1.0.0.tar.gz:
Publisher:
sdk-release.yml on drmain1/open_license
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
licensekit_sdk-1.0.0.tar.gz -
Subject digest:
2f94261e6d48450fbec8f20a40752d4612570a7d0e90e3587790bdf723c922b4 - Sigstore transparency entry: 1333981366
- Sigstore integration time:
-
Permalink:
drmain1/open_license@1e66b0dd95e68f3c6f9b51d14f4f500ac26f8140 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/drmain1
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
sdk-release.yml@1e66b0dd95e68f3c6f9b51d14f4f500ac26f8140 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file licensekit_sdk-1.0.0-py3-none-any.whl.
File metadata
- Download URL: licensekit_sdk-1.0.0-py3-none-any.whl
- Upload date:
- Size: 17.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7977d2b6fa88ce8ad4eee15cd535cbed6db6654351f386b7276b9bdb550248c3
|
|
| MD5 |
8185e460f41346065648b07c4996bcfe
|
|
| BLAKE2b-256 |
8ed560e2be4ebbcbbbbb3717cd947511395e0306546387ac806129d97e2074fe
|
Provenance
The following attestation bundles were made for licensekit_sdk-1.0.0-py3-none-any.whl:
Publisher:
sdk-release.yml on drmain1/open_license
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
licensekit_sdk-1.0.0-py3-none-any.whl -
Subject digest:
7977d2b6fa88ce8ad4eee15cd535cbed6db6654351f386b7276b9bdb550248c3 - Sigstore transparency entry: 1333981468
- Sigstore integration time:
-
Permalink:
drmain1/open_license@1e66b0dd95e68f3c6f9b51d14f4f500ac26f8140 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/drmain1
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
sdk-release.yml@1e66b0dd95e68f3c6f9b51d14f4f500ac26f8140 -
Trigger Event:
workflow_dispatch
-
Statement type: