Metadata-Version: 2.4
Name: digitea-licensing
Version: 1.1.2
Summary: Digitea Runtime licensing client
Requires-Python: >=3.10
Description-Content-Type: text/markdown
Requires-Dist: pydantic<3,>=2
Requires-Dist: urllib3<3,>=2

# Digitea Licensing Python SDK

Official Python client for the Digitea Runtime Licensing API.

The public facade is `DigiteaLicensing`. The OpenAPI-generated transport under `generated/` is an implementation detail.

## Installation

    pip install digitea-licensing

## Quick start

    from digitea_licensing import DigiteaLicensing

    client = DigiteaLicensing(
        product_id="prd_example123",
        timeout=10.0,
        retries=2,
    )

    activation = client.activate(
        license_key="dgt_lic_example",
        instance_id="stable-installation-id",
        instance_name="Customer workstation",
    )

    if activation.valid and activation.status == "ACTIVE":
        start_application()

The SDK persists an installation identity by default. Pass an explicit `instance_id` or provide an `InstanceIdStore` implementation when the application owns its secure storage.

## Complete lifecycle

    validation = client.validate(
        license_key,
        instance_id="stable-installation-id",
    )

    if validation.valid and validation.status == "ACTIVE":
        enable_licensed_features()

    deactivation = client.deactivate(
        license_key,
        instance_id="stable-installation-id",
    )

## Renewal session and idempotency

    renewal = client.create_renewal_session(
        license_key,
        instance_id="stable-installation-id",
        idempotency_key="renewal-operation-123",
    )

    open_in_browser(renewal.checkout_url)

Reuse the same `idempotency_key` when retrying the same logical renewal operation. If omitted, the SDK generates a valid key and reuses it across HTTP retries.

## Configuration

    client = DigiteaLicensing(
        product_id="prd_example123",
        base_url="https://api.getdigitea.com",
        timeout=10.0,
        retries=2,
    )

Runtime calls use only `product_id`, `license_key` and `instance_id`. No Developer API key is accepted or required.

## Errors

    from digitea_licensing import DigiteaError

    try:
        result = client.validate(license_key)
    except DigiteaError as error:
        print(error.code, error.status)
        if error.code == "LICENSE_EXPIRED":
            show_renewal_screen()
        elif error.code in {"NETWORK_ERROR", "TEMPORARILY_UNAVAILABLE"}:
            show_temporary_connection_error()

Digitea error codes are preserved. Temporary network, rate-limit and server failures are retried; definitive licensing decisions are not.

## Security

Never embed a Developer API key, webhook secret or server credential in distributed Python software. Never log a license key. Use HTTPS in production.

The same four operations are available in every Runtime SDK:

- `activate()`
- `validate()`
- `deactivate()`
- `create_renewal_session()`

Repository: https://github.com/Juste-Nick/Digitea
