Python client for the Keyva.dev license management API
Project description
Keyva Python Client
A Python client for interacting with the Keyva.dev license management API.
Installation
pip install keyva-client
Usage
1. Initialize the Client
from keyva import KeyvaClient
client = KeyvaClient("YOUR_API_KEY", public_key="YOUR_EdDSA_PUBLIC_KEY")
2. Validate a License
result = client.validate("LICENSE_KEY", release="1.0.0")
print("Valid:", result["valid"])
# Verify the signed token
if result.get("valid") and result.get("token"):
decoded = client.verify_token(result["token"])
print("Decoded:", decoded)
3. Create a License
license = client.create_license(
"PRODUCT_ID",
duration="1y", # or expires_at="2027-12-31T23:59:59Z"
feature_codes=["PRO", "ANALYTICS"],
allowed_ips=["192.168.1.1"],
release_versions=["1.0.0", "1.1.0"],
)
print("Created:", license)
4. Update a License
updated = client.update_license(
"LICENSE_KEY",
feature_codes=["PRO", "ANALYTICS", "TEAMS"],
duration="30d",
)
print("Updated:", updated)
5. Activate a License
activated = client.activate_license("LICENSE_KEY", duration="14d")
print("Activated:", activated)
6. Revoke a License
revoked = client.revoke_license("LICENSE_KEY")
print("Revoked:", revoked)
7. Delete a License
deleted = client.delete_license("LICENSE_KEY")
print("Deleted:", deleted)
Error Handling
All methods raise KeyvaError on non-2xx responses:
from keyva import KeyvaClient, KeyvaError
try:
result = client.validate("BAD_KEY")
except KeyvaError as e:
print(f"Error {e.status_code}: {e}")
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 keyva_client-0.1.0.tar.gz.
File metadata
- Download URL: keyva_client-0.1.0.tar.gz
- Upload date:
- Size: 6.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4448327a8a6ae5bd740d8abaaf26b11a3849f518e402520e386854c07ab09fb5
|
|
| MD5 |
51401fb21f52e86ad4d2f572e253a71d
|
|
| BLAKE2b-256 |
eb6d36aa002ac24bdd304290f2a597b222172367b49dc1fada1d4d6821f70af1
|
Provenance
The following attestation bundles were made for keyva_client-0.1.0.tar.gz:
Publisher:
publish-python.yml on KubiqIO/keyva-clients
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
keyva_client-0.1.0.tar.gz -
Subject digest:
4448327a8a6ae5bd740d8abaaf26b11a3849f518e402520e386854c07ab09fb5 - Sigstore transparency entry: 1025013789
- Sigstore integration time:
-
Permalink:
KubiqIO/keyva-clients@d5f8f097aa7f934f3fe6119686a9bc04ed440468 -
Branch / Tag:
refs/tags/python-v0.1.0 - Owner: https://github.com/KubiqIO
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-python.yml@d5f8f097aa7f934f3fe6119686a9bc04ed440468 -
Trigger Event:
push
-
Statement type:
File details
Details for the file keyva_client-0.1.0-py3-none-any.whl.
File metadata
- Download URL: keyva_client-0.1.0-py3-none-any.whl
- Upload date:
- Size: 5.9 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 |
ccf6bb6a15f7e7e7c65ae564ca1f7dd10c36d39e09b804aec29963c52100545c
|
|
| MD5 |
92006854bf2634107a6bc8df526e5df6
|
|
| BLAKE2b-256 |
e9d0b46595df72010844f65a5e8143d2b5db4e642885452c826254c4970af03d
|
Provenance
The following attestation bundles were made for keyva_client-0.1.0-py3-none-any.whl:
Publisher:
publish-python.yml on KubiqIO/keyva-clients
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
keyva_client-0.1.0-py3-none-any.whl -
Subject digest:
ccf6bb6a15f7e7e7c65ae564ca1f7dd10c36d39e09b804aec29963c52100545c - Sigstore transparency entry: 1025013851
- Sigstore integration time:
-
Permalink:
KubiqIO/keyva-clients@d5f8f097aa7f934f3fe6119686a9bc04ed440468 -
Branch / Tag:
refs/tags/python-v0.1.0 - Owner: https://github.com/KubiqIO
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-python.yml@d5f8f097aa7f934f3fe6119686a9bc04ed440468 -
Trigger Event:
push
-
Statement type: