Skip to content

Licensing

licensing

LicenseError

Bases: Exception

Raised when keplime cannot validate the license.

A single LicenseError type covers every license-validation outcome — missing file, malformed blob, bad Ed25519 signature, expired license, unsupported schema, or unsupported binding. The message embedded in the exception describes which case applies and what the user should do.

Raised at:

  • import keplime — if no license can be resolved or the resolved license fails any check. The Python import fails; the rest of the package is not available in this process.
  • install — if the supplied source is not a readable file or does not contain a valid blob.

Catch with:

try:
    import keplime
except keplime.LicenseError as exc:
    print(f"license problem: {exc}")

LicenseInfo

Bases: TypedDict

Dict shape returned by info.

info()

Returns metadata for the license active in this process.

Reads from the in-process cache populated at import time — does not re-run signature verification. Safe to call from hot paths.

Returns:

Type Description
LicenseInfo

Dict with keys license_id (str UUID), customer_id

LicenseInfo

(str), customer_name (str), issued_at (int

LicenseInfo

[unix-epoch seconds]), expires_at (Optional[int]

LicenseInfo

[unix-epoch seconds]; None for perpetual licenses), and

LicenseInfo

schema_version (int).

Raises:

Type Description
LicenseError

If no license has been validated in this process. In normal usage this is unreachable because import keplime would have failed first.

install(source)

Installs a license file at the default data-dir location.

The argument may be either the license blob itself (a string containing exactly one . separator) or a filesystem path to a file containing one. In either case the contents are written verbatim to {data_dir}/license.key so the next process to import keplime picks them up automatically.

Does not re-validate the current process — restart Python to pick up the new license.

Parameters:

Name Type Description Default
source str

License blob, or path to a file containing one.

required

Raises:

Type Description
LicenseError

If the source is unreadable, does not look like a license blob (missing . separator), or if the destination path cannot be written.