> ## Documentation Index
> Fetch the complete documentation index at: https://help.cryptolens.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Python SDK Reference

> Method signatures, returned data and settings for Python 3 and the legacy Python 2 / IronPython SDK.

Choose the reference for the version of Python you use. For installation and a first example, see the [Python guide](/libraries/python).

## Python 3

Python 3 package `licensing 0.54`. [Reviewed source revision](https://github.com/Cryptolens/cryptolens-python/tree/8f38b5a37580f2aba1c9374f581cdc85e251950f).

* [Key](/libraries/python-reference/python3/key) — Activate, retrieve, create and update license keys.
* [AI](/libraries/python-reference/python3/ai) — Read usage analytics and Web API logs, and record application events.
* [Message](/libraries/python-reference/python3/message) — Read, create and remove update messages.
* [Product](/libraries/python-reference/python3/product) — List products and search their license keys.
* [Customer](/libraries/python-reference/python3/customer) — Create customers and retrieve their associated licenses.
* [Data](/libraries/python-reference/python3/data) — Read and update data objects attached to licenses or activations.
* [PaymentForm](/libraries/python-reference/python3/payment-form) — Create payment-form sessions from your server.
* [Helpers](/libraries/python-reference/python3/helpers) — Compute machine codes and check individual license properties.
* [Subscription](/libraries/python-reference/python3/subscription) — Record metered usage for customer subscriptions.
* [User](/libraries/python-reference/python3/user) — Manage customer usernames, passwords and license associations.
* [ActivatedMachine](/libraries/python-reference/python3/activated-machine) — The activation details returned on a license.
* [Reseller](/libraries/python-reference/python3/reseller) — The reseller details returned on a license.
* [LicenseKey](/libraries/python-reference/python3/license-key) — The parsed license object, including saving and loading signed responses.
* [Response](/libraries/python-reference/python3/response) — The response envelope before its license data has been verified and parsed.
* [RSAPublicKey](/libraries/python-reference/python3/rsapublic-key) — The XML RSA public key used to check license signatures.
* [Settings](/libraries/python-reference/python3/settings)

## Python 2 / IronPython

Python 2 / IronPython implementation. [Reviewed source revision](https://github.com/Cryptolens/cryptolens-python/tree/8f38b5a37580f2aba1c9374f581cdc85e251950f).

* [Key](/libraries/python-reference/legacy/key) — Activate, retrieve and release licenses, and create trial keys.
* [Helpers](/libraries/python-reference/legacy/helpers) — Compute machine codes and compare activation identifiers.
* [ActivatedMachine](/libraries/python-reference/legacy/activated-machine) — The activation details returned on a license.
* [LicenseKey](/libraries/python-reference/legacy/license-key) — The parsed license object, including saving and loading signed responses.
* [Response](/libraries/python-reference/legacy/response) — The response envelope before its license data has been verified and parsed.
* [RSAPublicKey](/libraries/python-reference/legacy/rsapublic-key) — The XML RSA public key used to check license signatures.
* [Settings](/libraries/python-reference/legacy/settings)

## FAQ

<AccordionGroup>
  <Accordion title="Which Reference Should I Use?" id="which-reference-should-i-use">
    Use **Python 3** when you install `licensing` with pip. Use **Python 2 / IronPython** when you copy `cryptolens_python2.py` into an older application. Their available methods and parameters differ; the legacy implementation is not a copy of every Python 3 feature.
  </Accordion>

  <Accordion title="Can I Call Every Web API Method Through This SDK?" id="can-i-call-every-web-api-method-through-this-sdk">
    No. These pages list the methods this SDK exposes. If a Web API method has no Python wrapper, use its documented HTTP endpoint. For example, retrieving an existing customer secret requires [GetCustomers](/api-reference/generated/GetCustomers); the Python SDK has no `Customer.get_customers` method.
  </Accordion>

  <Accordion title="Does a Successful SDK Call Complete Every License Check?" id="does-a-successful-sdk-call-complete-every-license-check">
    `Key.activate` and `Key.get_key` verify the returned license signature. Your application still decides whether the license permits the requested work. See the [license-check FAQ](/examples/key-verification#does-a-successful-api-response-mean-the-license-is-valid) for product, feature, expiry, blocking and machine checks.
  </Accordion>
</AccordionGroup>

## Previous Reference Links

These links keep bookmarks to the earlier reference working.

<a id="licensing" />

<a id="licensing.internal" />

<a id="licensing.methods" />

<a id="licensing.models" />

<a id="licensing.internal.HelperMethods" />

<a id="licensing.internal.HelperMethods.get_SHA256" />

<a id="licensing.internal.HelperMethods.verify_signature" />

<a id="licensing.internal.HelperMethods.send_request" />

Low-level request and cryptography helpers are implementation details. Use the documented [settings](/libraries/python-reference/python3/settings) or the public methods below.

| Previous Section | Reference |
| - | - |
| <a id="licensing.methods.Key" />`Key` | [Open Reference](/libraries/python-reference/python3/key) |
| <a id="licensing.methods.Key.activate" />`Key.activate` | [Open Reference](/libraries/python-reference/python3/key#licensing.methods.Key.activate) |
| <a id="licensing.methods.Key.get_key" />`Key.get_key` | [Open Reference](/libraries/python-reference/python3/key#licensing.methods.Key.get_key) |
| <a id="licensing.methods.Key.create_trial_key" />`Key.create_trial_key` | [Open Reference](/libraries/python-reference/python3/key#licensing.methods.Key.create_trial_key) |
| <a id="licensing.methods.Key.create_key" />`Key.create_key` | [Open Reference](/libraries/python-reference/python3/key#licensing.methods.Key.create_key) |
| <a id="licensing.methods.Key.deactivate" />`Key.deactivate` | [Open Reference](/libraries/python-reference/python3/key#licensing.methods.Key.deactivate) |
| <a id="licensing.methods.Key.extend_license" />`Key.extend_license` | [Open Reference](/libraries/python-reference/python3/key#licensing.methods.Key.extend_license) |
| <a id="licensing.methods.Key.change_customer" />`Key.change_customer` | [Open Reference](/libraries/python-reference/python3/key#licensing.methods.Key.change_customer) |
| <a id="licensing.methods.Key.unblock_key" />`Key.unblock_key` | [Open Reference](/libraries/python-reference/python3/key#licensing.methods.Key.unblock_key) |
| <a id="licensing.methods.Key.block_key" />`Key.block_key` | [Open Reference](/libraries/python-reference/python3/key#licensing.methods.Key.block_key) |
| <a id="licensing.methods.Key.machine_lock_limit" />`Key.machine_lock_limit` | [Open Reference](/libraries/python-reference/python3/key#licensing.methods.Key.machine_lock_limit) |
| <a id="licensing.methods.Key.change_notes" />`Key.change_notes` | [Open Reference](/libraries/python-reference/python3/key#licensing.methods.Key.change_notes) |
| <a id="licensing.methods.Key.change_reseller" />`Key.change_reseller` | [Open Reference](/libraries/python-reference/python3/key#licensing.methods.Key.change_reseller) |
| <a id="licensing.methods.Key.create_key_from_template" />`Key.create_key_from_template` | [Open Reference](/libraries/python-reference/python3/key#licensing.methods.Key.create_key_from_template) |
| <a id="licensing.methods.Key.add_feature" />`Key.add_feature` | [Open Reference](/libraries/python-reference/python3/key#licensing.methods.Key.add_feature) |
| <a id="licensing.methods.Key.remove_feature" />`Key.remove_feature` | [Open Reference](/libraries/python-reference/python3/key#licensing.methods.Key.remove_feature) |
| <a id="licensing.methods.AI" />`AI` | [Open Reference](/libraries/python-reference/python3/ai) |
| <a id="licensing.methods.AI.get_web_api_log" />`AI.get_web_api_log` | [Open Reference](/libraries/python-reference/python3/ai#licensing.methods.AI.get_web_api_log) |
| <a id="licensing.methods.AI.get_events" />`AI.get_events` | [Open Reference](/libraries/python-reference/python3/ai#licensing.methods.AI.get_events) |
| <a id="licensing.methods.AI.register_event" />`AI.register_event` | [Open Reference](/libraries/python-reference/python3/ai#licensing.methods.AI.register_event) |
| <a id="licensing.methods.Message" />`Message` | [Open Reference](/libraries/python-reference/python3/message) |
| <a id="licensing.methods.Message.get_messages" />`Message.get_messages` | [Open Reference](/libraries/python-reference/python3/message#licensing.methods.Message.get_messages) |
| <a id="licensing.methods.Message.create_message" />`Message.create_message` | [Open Reference](/libraries/python-reference/python3/message#licensing.methods.Message.create_message) |
| <a id="licensing.methods.Message.remove_message" />`Message.remove_message` | [Open Reference](/libraries/python-reference/python3/message#licensing.methods.Message.remove_message) |
| <a id="licensing.methods.Product" />`Product` | [Open Reference](/libraries/python-reference/python3/product) |
| <a id="licensing.methods.Product.get_products" />`Product.get_products` | [Open Reference](/libraries/python-reference/python3/product#licensing.methods.Product.get_products) |
| <a id="licensing.methods.Product.get_keys" />`Product.get_keys` | [Open Reference](/libraries/python-reference/python3/product#licensing.methods.Product.get_keys) |
| <a id="licensing.methods.Customer" />`Customer` | [Open Reference](/libraries/python-reference/python3/customer) |
| <a id="licensing.methods.Customer.add_customer" />`Customer.add_customer` | [Open Reference](/libraries/python-reference/python3/customer#licensing.methods.Customer.add_customer) |
| <a id="licensing.methods.Customer.get_customer_licenses" />`Customer.get_customer_licenses` | [Open Reference](/libraries/python-reference/python3/customer#licensing.methods.Customer.get_customer_licenses) |
| <a id="licensing.methods.Customer.get_customer_licenses_by_secret" />`Customer.get_customer_licenses_by_secret` | [Open Reference](/libraries/python-reference/python3/customer#licensing.methods.Customer.get_customer_licenses_by_secret) |
| <a id="licensing.methods.Data" />`Data` | [Open Reference](/libraries/python-reference/python3/data) |
| <a id="licensing.methods.Data.increment_int_value_to_key" />`Data.increment_int_value_to_key` | [Open Reference](/libraries/python-reference/python3/data#licensing.methods.Data.increment_int_value_to_key) |
| <a id="licensing.methods.Data.decrement_int_value_to_key" />`Data.decrement_int_value_to_key` | [Open Reference](/libraries/python-reference/python3/data#licensing.methods.Data.decrement_int_value_to_key) |
| <a id="licensing.methods.Data.add_data_object_to_key" />`Data.add_data_object_to_key` | [Open Reference](/libraries/python-reference/python3/data#licensing.methods.Data.add_data_object_to_key) |
| <a id="licensing.methods.Data.remove_data_object_to_key" />`Data.remove_data_object_to_key` | [Open Reference](/libraries/python-reference/python3/data#licensing.methods.Data.remove_data_object_to_key) |
| <a id="licensing.methods.Data.add_data_object_to_machine" />`Data.add_data_object_to_machine` | [Open Reference](/libraries/python-reference/python3/data#licensing.methods.Data.add_data_object_to_machine) |
| <a id="licensing.methods.Data.remove_data_object_to_machine" />`Data.remove_data_object_to_machine` | [Open Reference](/libraries/python-reference/python3/data#licensing.methods.Data.remove_data_object_to_machine) |
| <a id="licensing.methods.Data.list_machine_data_objects" />`Data.list_machine_data_objects` | [Open Reference](/libraries/python-reference/python3/data#licensing.methods.Data.list_machine_data_objects) |
| <a id="licensing.methods.Data.list_key_data_objects" />`Data.list_key_data_objects` | [Open Reference](/libraries/python-reference/python3/data#licensing.methods.Data.list_key_data_objects) |
| <a id="licensing.methods.PaymentForm" />`PaymentForm` | [Open Reference](/libraries/python-reference/python3/payment-form) |
| <a id="licensing.methods.PaymentForm.create_session" />`PaymentForm.create_session` | [Open Reference](/libraries/python-reference/python3/payment-form#licensing.methods.PaymentForm.create_session) |
| <a id="licensing.methods.Helpers" />`Helpers` | [Open Reference](/libraries/python-reference/python3/helpers) |
| <a id="licensing.methods.Helpers.GetMachineCode" />`Helpers.GetMachineCode` | [Open Reference](/libraries/python-reference/python3/helpers#licensing.methods.Helpers.GetMachineCode) |
| <a id="licensing.methods.Helpers.IsOnRightMachine" />`Helpers.IsOnRightMachine` | [Open Reference](/libraries/python-reference/python3/helpers#licensing.methods.Helpers.IsOnRightMachine) |
| <a id="licensing.methods.Helpers.GetMACAddress" />`Helpers.GetMACAddress` | [Open Reference](/libraries/python-reference/python3/helpers#licensing.methods.Helpers.GetMACAddress) |
| <a id="licensing.methods.Helpers.HasNotExpired" />`Helpers.HasNotExpired` | [Open Reference](/libraries/python-reference/python3/helpers#licensing.methods.Helpers.HasNotExpired) |
| <a id="licensing.methods.Helpers.HasFeature" />`Helpers.HasFeature` | [Open Reference](/libraries/python-reference/python3/helpers#licensing.methods.Helpers.HasFeature) |
| <a id="licensing.methods.Subscription" />`Subscription` | [Open Reference](/libraries/python-reference/python3/subscription) |
| <a id="licensing.methods.Subscription.record_usage_to_stripe" />`Subscription.record_usage_to_stripe` | [Open Reference](/libraries/python-reference/python3/subscription#licensing.methods.Subscription.record_usage_to_stripe) |
| <a id="licensing.methods.User" />`User` | [Open Reference](/libraries/python-reference/python3/user) |
| <a id="licensing.methods.User.login" />`User.login` | [Open Reference](/libraries/python-reference/python3/user#licensing.methods.User.login) |
| <a id="licensing.methods.User.register" />`User.register` | [Open Reference](/libraries/python-reference/python3/user#licensing.methods.User.register) |
| <a id="licensing.methods.User.associate" />`User.associate` | [Open Reference](/libraries/python-reference/python3/user#licensing.methods.User.associate) |
| <a id="licensing.methods.User.dissociate" />`User.dissociate` | [Open Reference](/libraries/python-reference/python3/user#licensing.methods.User.dissociate) |
| <a id="licensing.methods.User.get_users" />`User.get_users` | [Open Reference](/libraries/python-reference/python3/user#licensing.methods.User.get_users) |
| <a id="licensing.methods.User.change_password" />`User.change_password` | [Open Reference](/libraries/python-reference/python3/user#licensing.methods.User.change_password) |
| <a id="licensing.methods.User.reset_password_token" />`User.reset_password_token` | [Open Reference](/libraries/python-reference/python3/user#licensing.methods.User.reset_password_token) |
| <a id="licensing.methods.User.remove_user" />`User.remove_user` | [Open Reference](/libraries/python-reference/python3/user#licensing.methods.User.remove_user) |
| <a id="licensing.models.Reseller" />`Reseller` | [Open Reference](/libraries/python-reference/python3/reseller) |
| <a id="licensing.models.LicenseKey" />`LicenseKey` | [Open Reference](/libraries/python-reference/python3/license-key) |
| <a id="licensing.models.LicenseKey.save_as_string" />`LicenseKey.save_as_string` | [Open Reference](/libraries/python-reference/python3/license-key#licensing.models.LicenseKey.save_as_string) |
| <a id="licensing.models.LicenseKey.load_from_string" />`LicenseKey.load_from_string` | [Open Reference](/libraries/python-reference/python3/license-key#licensing.models.LicenseKey.load_from_string) |
| <a id="licensing.models.RSAPublicKey" />`RSAPublicKey` | [Open Reference](/libraries/python-reference/python3/rsapublic-key) |
| <a id="licensing.models.RSAPublicKey.from_string" />`RSAPublicKey.from_string` | [Open Reference](/libraries/python-reference/python3/rsapublic-key#licensing.models.RSAPublicKey.from_string) |
