Skip to main content

SunLicense — Python Client

Official Python client for SunLicense, a licence management and anti-piracy system for indie software developers.

SunLicense issues, validates and revokes licence keys for Minecraft plugins, Discord bots, FiveM scripts, desktop apps and other paid software — with marketplace automation for BuiltByBit and Polymart.

Early release. Licence validation works today. The wider client surface — activations, entitlements and offline verification — is in active development.

Install

pip install sunlicense

No dependencies — standard library only.

Usage

from sunlicense import SunLicense

client = SunLicense(
    base_url="https://your-instance.example.com",
    token="optional-api-token",
)

result = client.validate("LICENCE-KEY-HERE")

if result.valid:
    print("Licence is valid")
else:
    print("Rejected:", result.status, result.data)

Pass extra context as keyword arguments:

result = client.validate("LICENCE-KEY-HERE", product="my-plugin", host="server-01")

SunLicense(...)

Argument Type Default Description
base_url str — Required. Base URL of your SunLicense instance
token str None API token, if your endpoint requires one
timeout float 10.0 Request timeout in seconds

validate(license_key, **context) -> ValidationResult

Returns a named tuple with valid (bool), status (int) and data (the parsed JSON body, the body as text when it isn't JSON, or None when it's empty).

Requests carry the header User-Agent: sunlicense-python/<version>.

Changelog

  • 0.0.2: send a sunlicense-python/<version> User-Agent. 0.0.1 sent urllib's default (Python-urllib/3.x), which Cloudflare in front of api.sunlicense.com refuses with 403 and the text body error code: 1010, so every validation failed. A body that isn't JSON is now returned as text in data instead of None.
  • 0.0.1: first release.

Requirements

Python 3.8 or newer.

Other clients

SunLicense also provides clients for Java, JavaScript, PHP and Lua.

Licence

MIT © Hapangama

Metadata

Release files for sunlicense 0.0.2

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

Source distribution (sdist)

Source distribution for sunlicense 0.0.2
File Size Uploaded Provenance Actions
sunlicense-0.0.2.tar.gz 5.9 kB Without provenance Details for sunlicense-0.0.2.tar.gz

Built distribution (wheel)

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

Total release size: 10.9 kB

Release files / sunlicense-0.0.2.tar.gz

Download URL sunlicense-0.0.2.tar.gz
Size 5.9 kB
Tags Source
SHA-256 checksum
How to use checksums
b94de05ad381e465a47203a27781ba60972b80aaaf3e99da7d9d141e66f6a294
BLAKE2b-256 checksum
How to use checksums
d015d2919bfd80eb2b2bbe026feb29c4e488ee905872e689516a606abaf334f7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.6

Release files / sunlicense-0.0.2-py3-none-any.whl

Download URL sunlicense-0.0.2-py3-none-any.whl
Size 5.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
226784bd6e1ae345c10ec302020cdb616e5521924ac01d03d413c9b5061f468d
BLAKE2b-256 checksum
How to use checksums
8c3672f1c442e54f20ea08f6456914c2a0a2f99407c66be6b58d8af282ed2137
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.6

Security for sunlicense 0.0.2

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

0.0.2 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