---
title: "Activating Nutrient Python SDK with a license key"
canonical_url: "https://www.nutrient.io/guides/python/license-activation/"
md_url: "https://www.nutrient.io/guides/python/license-activation.md"
last_updated: "2026-05-26T09:21:30.464Z"
description: "Activate Nutrient Python SDK using your license key before running document workflows."
---

# Activating Nutrient Python SDK with a license key

Activate Nutrient Python SDK with your license key before you call any other SDK API. This step enables licensed features in your application.

[Download sample](https://www.nutrient.io/downloads/samples/python/license-activation.zip)

## How Nutrient supports this workflow

Nutrient Python SDK provides a license activation API.

You don’t need to manage:

- License validation logic

- Feature configuration logic

- Multi-step SDK initialization flow

Register your key once at startup, then continue with document operations.

## Complete implementation

This example shows how to register a license key and then run an SDK operation.

Import the required Nutrient classes:

```python

from nutrient_sdk import License
from nutrient_sdk import Document
from nutrient_sdk import NutrientException

```

Register the key before any other SDK usage. Replace the empty string with your license key. Catch `NutrientException` to handle activation or runtime failures:

```python

def main():
    try:
        # Initialize the SDK with your license key before using any other SDK classes

        # Replace the empty string with your license key: License.register_key("YOUR_LICENSE_KEY_GOES_HERE")

        License.register_key("")

        # Now you can use the SDK - example: convert a document

        with Document.open("input.pdf") as document:
            document.export_as_pdf("output.pdf")
            print("Successfully converted to output.pdf")
    except NutrientException as e:
        print(f"Error: {e}")

if __name__ == "__main__":
    main()

```

## Summary

The activation flow has two steps:

1. Call `License.register_key()` before any other SDK usage.

2. Run SDK operations after registration.

Nutrient handles license validation and feature enablement, so you don’t need to manage SDK initialization state yourself.

You can download [this sample package](https://www.nutrient.io/downloads/samples/python/license-activation.zip) to run the example locally.
---

## Related pages

- [Python SDK sample downloads](/guides/python/downloads.md)
- [Changelog for Python](/guides/python/changelog.md)
- [Nutrient Python SDK](/guides/python.md)
- [Python guides: Integrate our PDF SDK](/guides/python/intro.md)

