Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

keymint-2.1.0.tar.gz (9.8 kB view details)

Uploaded Source

Built Distribution

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

keymint-2.1.0-py3-none-any.whl (9.1 kB view details)

Uploaded Python 3

File details

Details for the file keymint-2.1.0.tar.gz.

File metadata

  • Download URL: keymint-2.1.0.tar.gz
  • Upload date:
  • Size: 9.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.6

File hashes

Hashes for keymint-2.1.0.tar.gz
Algorithm Hash digest
SHA256 4555af4689db7c5311c59c185ede652ff6ab7564c84f915d99330a57d8ac8ed9
MD5 94b44e3777fe2e73def06cd78099644f
BLAKE2b-256 ad05fda6f43c22de6ecd423093bfea08e32ffef34b50d3d57ceb7bb4a53adf1d

See more details on using hashes here.

File details

Details for the file keymint-2.1.0-py3-none-any.whl.

File metadata

  • Download URL: keymint-2.1.0-py3-none-any.whl
  • Upload date:
  • Size: 9.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.6

File hashes

Hashes for keymint-2.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e368878a620180136f1634b35fb828cd4a62fc1b1d4dcf69e3830b946600e98b
MD5 0cacec4567ff7f1ac2f3dfde0d617256
BLAKE2b-256 92b58d7caec041f85379c3688f3f391fd3c5360a08b95e4f7c9646817474f0ef

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