Python SDK for licensekit.dev
Project description
licensekit-sdk
Public Python SDK source for licensekit.dev.
This repository is the standalone home of the PyPI package licensekit-sdk. It contains the published client source, examples, tests, and the OpenAPI snapshot used to generate the typed client surface.
Links:
- product site:
https://licensekit.dev - hosted API:
https://api.licensekit.dev - TypeScript SDK:
https://www.npmjs.com/package/@licensekit/sdk
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.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"])
Examples
Examples live in examples/:
01_create_scoped_api_key.py02_runtime_validate_and_verify.py
Development
python3 -m venv .venv
source .venv/bin/activate
pip install -e '.[dev]'
python scripts/generate_from_openapi.py
pytest
python -m build
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-0.1.0a0.tar.gz.
File metadata
- Download URL: licensekit_sdk-0.1.0a0.tar.gz
- Upload date:
- Size: 24.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9d08d74b70469fc30e53fffd294048faa9f1bc6072c31af36840775fbb168a8e
|
|
| MD5 |
7a5af5e8403a11a8e45bdad8114946f8
|
|
| BLAKE2b-256 |
0d547436a5c46807424f532a11977effbaac0f20693d91b23bae6f851ecb48c6
|
Provenance
The following attestation bundles were made for licensekit_sdk-0.1.0a0.tar.gz:
Publisher:
release.yml on drmain1/licensekit-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
licensekit_sdk-0.1.0a0.tar.gz -
Subject digest:
9d08d74b70469fc30e53fffd294048faa9f1bc6072c31af36840775fbb168a8e - Sigstore transparency entry: 1180432744
- Sigstore integration time:
-
Permalink:
drmain1/licensekit-python@37ffe8c22ccce988a17be79d4daa5e66fcabfdc7 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/drmain1
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@37ffe8c22ccce988a17be79d4daa5e66fcabfdc7 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file licensekit_sdk-0.1.0a0-py3-none-any.whl.
File metadata
- Download URL: licensekit_sdk-0.1.0a0-py3-none-any.whl
- Upload date:
- Size: 15.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a090732ae968f03a6239d04c5bdf3fe25ed4cb4a890284a5f09586230eeb0fdf
|
|
| MD5 |
ab561b63f12eff9bc09ad5dd37420372
|
|
| BLAKE2b-256 |
2889761204b08a06e1e17c029bab9d663cd72dafd9020cebd5c625f55e872226
|
Provenance
The following attestation bundles were made for licensekit_sdk-0.1.0a0-py3-none-any.whl:
Publisher:
release.yml on drmain1/licensekit-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
licensekit_sdk-0.1.0a0-py3-none-any.whl -
Subject digest:
a090732ae968f03a6239d04c5bdf3fe25ed4cb4a890284a5f09586230eeb0fdf - Sigstore transparency entry: 1180432796
- Sigstore integration time:
-
Permalink:
drmain1/licensekit-python@37ffe8c22ccce988a17be79d4daa5e66fcabfdc7 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/drmain1
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@37ffe8c22ccce988a17be79d4daa5e66fcabfdc7 -
Trigger Event:
workflow_dispatch
-
Statement type: