Official Python SDK for KeyMint license management with comprehensive API coverage.
Project description
KeyMint Python SDK
A professional, production-ready SDK for integrating with the KeyMint API in Python. Provides robust access to all major KeyMint features, with type hints and modern error handling.
Features
- Type hints: Full type hint support for better IDE integration and code safety.
- Comprehensive: Complete API coverage for all KeyMint endpoints.
- Consistent error handling: All API errors are returned as structured objects or exceptions.
- Security: Credentials are always loaded from environment variables.
Installation
Add the SDK to your project:
pip install keymint
Usage
import os
import keymint
access_token = os.environ.get('KEYMINT_ACCESS_TOKEN')
product_id = os.environ.get('KEYMINT_PRODUCT_ID')
if not access_token or not product_id:
raise ValueError('Please set the KEYMINT_ACCESS_TOKEN and KEYMINT_PRODUCT_ID environment variables.')
sdk = keymint.KeyMint(access_token)
# Example: Create a key
result = sdk.create_key({ 'productId': product_id })
if result and 'key' in result:
key = result['key']
# ...
else:
# Handle error
pass
Error Handling
All SDK methods return a dictionary. If an API call fails, the SDK raises a KeyMintApiError exception with message, code, and status attributes.
API Methods
All methods return a dictionary.
License Key Management
| Method | Description |
|---|---|
create_key |
Creates a new license key. |
activate_key |
Activates a license key for a device. |
deactivate_key |
Deactivates a device from a license key. |
get_key |
Retrieves detailed information about a key. |
block_key |
Blocks a license key. |
unblock_key |
Unblocks a previously blocked license key. |
Customer Management
| Method | Description |
|---|---|
create_customer |
Creates a new customer. |
get_all_customers |
Retrieves all customers. |
get_customer_by_id |
Gets a specific customer by ID. |
get_customer_with_keys |
Gets a customer along with their license keys. |
update_customer |
Updates customer information. |
toggle_customer_status |
Toggles customer active status. |
delete_customer |
Permanently deletes a customer and their keys. |
For detailed parameter and response types, see the KeyMint API docs or use your IDE's autocomplete.
License
MIT
Support
For help, see KeyMint API docs or open an issue.
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 keymint-2.0.0.tar.gz.
File metadata
- Download URL: keymint-2.0.0.tar.gz
- Upload date:
- Size: 5.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
786d70a2091058b6c070f8451e18f6e1a5a52b2062e4cf89afbfe88c1f808fd6
|
|
| MD5 |
cf9ae34b9548d0e0acade54f5c4a62ed
|
|
| BLAKE2b-256 |
91c71412d6da7d6ecf4615d371746abebe7e6a433fd3f0ae5813a44f724888c5
|
File details
Details for the file keymint-2.0.0-py3-none-any.whl.
File metadata
- Download URL: keymint-2.0.0-py3-none-any.whl
- Upload date:
- Size: 6.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
31ac29f6a25b04fd996e1da1f35431ee755cf87fe484ab8a5fe7688fe433aa10
|
|
| MD5 |
d365ee0762c190dbc0d81c6981fd4f10
|
|
| BLAKE2b-256 |
dff95d9cb9f65883f9a75b04a5fa5fa7097b84e7231a6168ae33fe6b1a5193f4
|