Skip to main content

licencly

Verify Licencly licenses and check for entitled updates, from Python.

pip install licencly

One runtime dependency (cryptography, for Ed25519, which Python has none of in the standard library). HTTP uses stdlib urllib. Python 3.9+.

The idea

The signed license file is the answer; the network is an optimisation. The client reads its cache, refreshes when due, and keeps working through an outage until the grace period is spent, so Licencly being unreachable never stops software you have already sold.

Quickstart

Copy the product UUID and public key from your dashboard and embed them at build time. Fetching keys at runtime would defeat the whole scheme.

from licencly import LicenclyClient, Outcome, is_network_error

client = LicenclyClient(
    product_uuid="fec65576-…",
    # Products → your product → Signing key.
    public_keys={"9f2c1a44-…": "MWvD7YE6HjI/DQ0kYGJFNG4kXlx4hP6ck1Vr4j77fzk="},
    fingerprint=machine_id(),  # yours; see below
)

decision = client.validate(user_entered_key)

if decision.outcome is Outcome.VALID:
    ...  # run
elif decision.outcome is Outcome.NOT_ACTIVE:
    show("This license has been suspended or revoked.")
elif decision.outcome is Outcome.EXPIRED:
    show("This license expired. Renew to continue.")
elif decision.outcome is Outcome.WRONG_MACHINE:
    show("This license is in use on another machine.")
elif decision.outcome is Outcome.STALE:
    show("Please connect to the internet to re-check your license.")
elif decision.outcome is Outcome.INVALID:
    show("This license file could not be verified.")

validate makes no network call at all while the cached file is still fresh.

Offline

When Behaviour
Before rev Cache only, no network
Between rev and rev + grace Keeps working, refreshes in the background. needs_revalidation is true
After rev + grace Outcome.STALE

A network failure inside the grace window is not an error your users should see. Check is_network_error(err) and stay quiet.

Updates

result = client.check_for_update(key, current_version="1.2.0", platform=sys.platform)

if result.available:
    path = client.download_artifact(key, result.release, "/tmp/updates", artifact_key)
elif result.renewal_would_unlock:
    # Not an error: a newer version exists and this license is not entitled to
    # it. result.latest names what renewing would unlock.
    show(f"Version {result.latest.version} is available with an active plan.")

Checking for updates never consumes a seat.

Verifying downloads

artifact_key is your own Ed25519 public key, compiled into your application, not fetched from Licencly. Licencly stores and serves the signature but cannot produce one, so a compromise of Licencly cannot push code to your users. download_artifact verifies the digest and that signature before the file is moved into place; passing None reduces it to corruption detection.

Packaged applications

If you ship with PyInstaller or similar, remember the public key is inside a bundle a determined user can unpack and patch. That is true of every offline licensing scheme, in every language. The signature stops casual sharing and tampering with the license, not a reverse engineer with an afternoon.

Machine fingerprints

The SDK does not compute one, because a good fingerprint is specific to what you ship. It must stay stable across restarts, app updates and reboots, and survive minor hardware change. VMs, containers and cloned disks all defeat naive approaches. Budget more thought than it looks like it needs.

Omitting fingerprint disables machine binding, and a license file copied to another machine will still verify.

Clock tampering

Expiry is checked against a clock the user controls; rolling it back extends an expired license offline. This is unavoidable for anything that must work without a network.

The SDK records the furthest-forward time it has seen and rejects a jump backwards of more than 24 hours. That is a speed bump, not a fix.

Errors worth telling apart

Check Meaning
is_network_error(err) Could not reach the server. Retryable, silent inside grace
is_tampering(err) Signature or format failure. Never retry
err.seat_limit_reached No free activations
err.not_found Unknown product or key
err.rate_limited Carries retry_after_seconds

Conformance

PYTHONPATH=src python -m unittest discover -s tests

Runs tests/data/vectors.json, the same suite every Licencly SDK runs. If this SDK ever disagrees with the Go, TypeScript or .NET ones, that test fails first.

Metadata

Release files for licencly 1.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for licencly 1.0.1
File Size Uploaded Provenance Actions
licencly-1.0.1.tar.gz 27.6 kB Without provenance Details for licencly-1.0.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for licencly 1.0.1
File Interpreter ABI Platform Actions
licencly-1.0.1-py3-none-any.whl Python 3 none any Details for licencly-1.0.1-py3-none-any.whl

Total release size: 51.7 kB

Release files / licencly-1.0.1.tar.gz

Download URL licencly-1.0.1.tar.gz
Size 27.6 kB
Tags Source
SHA-256 checksum
How to use checksums
0989bff57062e1d4ec01ff3e6f05fca552f0fc77b5134f75f86ca2d4b38e29b5
BLAKE2b-256 checksum
How to use checksums
5cdcac8c467fa3f568ef5d387aa3547bfcbb7ae083fc803ec442dfc227df4109
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.10

Release files / licencly-1.0.1-py3-none-any.whl

Download URL licencly-1.0.1-py3-none-any.whl
Size 24.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7ca1ac3d849d8e17ba281b4f47be23e14af7c79a79c40c420b69680c270a2548
BLAKE2b-256 checksum
How to use checksums
f8c52d1ad668bc24192a66598ccf771344778dfaff3a629adec2c009055b0acd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.10

Security for licencly 1.0.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.0.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page