Python software licensing

Getting started with license key verifications in Python

Installing the Python SDK

The easiest way to add software licensing into your Python application is by installing our Python SDK, available open source on GitHub. If you application works with Autodesk Maya, Autodesk Revit or Iron Python, please read more on how to install the Python 2 version of the library on GitHub.

Example key verification

The code below verifies a license key with our API. This example is covered in more detail on this page. If your application needs to work offline, please use this code snippet instead.

RSAPubKey = "RSA Public Key"
auth = "Access token with Activate permission"

result = Key.activate(token=auth,\
                   rsa_pub_key=RSAPubKey,\
                   product_id=3349, \
                   key="ICVLD-VVSZR-ZTICT-YKGXL",\
                   machine_code=Helpers.GetMachineCode(v=2))

if result[0] == None or not Helpers.IsOnRightMachine(result[0], v=2):
    # an error occurred or the key is invalid or it cannot be activated
    # (eg. the limit of activated devices was achieved)
    print("The license does not work: {0}".format(result[1]))
else:
    # everything went fine if we are here!
    print("The license is valid!")
    license_key = result[0]
    print("Feature 1: " + str(license_key.f1))
    print("License expires: " + str(license_key.expires))

For more information on how to obtain the parameters, please read more here.

Some of the companies using the Python SDK

Website: https://forcetechnology.com/en

Related articles