Python tools for Keygen.sh licensing
Project description
kgt
Some handy tools for the Keygen licensing service. (This is a user contribution, not an official Keygen LLC product. For Keygen software, see here.)
Install with
pip install kgt
and use as
import sys
from kgt import get_online_license_info, ValidationError
info = get_online_license_info(
account_id="demo", key="DEMO-DAD877-FCBF82-B83D5A-03E644-V3"
)
The out
object contains useful information such as
out.code
out.timestamp
out.license_creation_time
out.license_expiry_time
The validation result can also be safely cached with
import sys
from datetime import datetime, timedelta
from kgt import get_cached_license_info, ValidationError
infi = get_cached_license_info(
account_id="your accound id",
key="the license key",
keygen_verify_key="your Ed25519 128-bit Verify Key",
cache_path="/tmp/license-cache.json",
refresh_cache_period=timedelta(days=3),
)
now = datetime.utcnow()
cache_age = now - out.timestamp
if cache_age > timedelta(days=3) and cache_age < timedelta(days=7):
print("Warning: Could not validate license. Make sure to get online soon.")
elif cache_age > timedelta(days=7):
print("Error: Could not validate license. Internet connection needed. Exiting.")
sys.exit(1)
For offline validation, use
from kgt import get_offline_license_info
# or "RSA_2048_PKCS1_SIGN_V2", "RSA_2048_PKCS1_PSS_SIGN_V2":
license_scheme = "ED25519_SIGN"
keygen_verify_key = "your public verify key"
license_key = "your offline license key"
info = get_offline_license_info(license_scheme, license_key, keygen_verify_key)
print(info)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distributions
kgt-0.4.2-cp310-cp310-win_amd64.whl
(192.6 kB
view hashes)
kgt-0.4.2-cp39-cp39-win_amd64.whl
(191.9 kB
view hashes)
kgt-0.4.2-cp38-cp38-win_amd64.whl
(191.5 kB
view hashes)
kgt-0.4.2-cp37-cp37m-win_amd64.whl
(186.2 kB
view hashes)
Close
Hashes for kgt-0.4.2-cp310-cp310-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 960c96da196da4ba754f1045a94bad7c758e213dac827e2c840be85c66df284d |
|
MD5 | 831139d2522f61f8313d7abfde0439c4 |
|
BLAKE2b-256 | a405adbad50453ce0fdfad10a5fe954fd31c2d39cbc239e4362f9b705459ba7d |
Close
Hashes for kgt-0.4.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8f056fff880959f8bbeff5e83f54820b164853f48fb36272866e1fc8ab681225 |
|
MD5 | 1e26c0cf5aaac326e951d914ea1f483a |
|
BLAKE2b-256 | 7147241788cccdc6c45ecc8e413433d082f3be91ef89c88a97324ca3f4659200 |
Close
Hashes for kgt-0.4.2-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6f0c50670f86ac7608d247b20a3214d618fd67d7b190b568d5baf08c556356e2 |
|
MD5 | 286ebcfa0b7d0d67de6dc682d155ceff |
|
BLAKE2b-256 | 3265f94458892bb588ba4235632e7f03c9c88fa9a8a4f6b7a02dd112f173a242 |
Close
Hashes for kgt-0.4.2-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 72b3979c004f666240a47baf219c595976a86e6c98e09034e80272371e6a1ca9 |
|
MD5 | ac5c3b6ebc15c1164b33e3499d9f6896 |
|
BLAKE2b-256 | e723f5914901c5c6bb74fea9b3c311c8a54861d4b7c08bee34a7c0be2fd9a1a6 |
Close
Hashes for kgt-0.4.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5c2a3373909308db1cae93107790abf4a24386f2b474b5ce7db0ab35f52f4e6f |
|
MD5 | e5665bc632a815cbe7acd767911348bb |
|
BLAKE2b-256 | 8346754eaf81fae11ad7a651d1710f1d054e8ec3c29050abf0f0de8c36d5f171 |
Close
Hashes for kgt-0.4.2-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4b648a25ec28f3c6f378d96b4f117bb9603ef2ea9a9db92062f1a8b9b13d4853 |
|
MD5 | b00e1b0bc9b6d8298609f8380c229e7a |
|
BLAKE2b-256 | fd15fe3ecaf8166f047b835f3371b504cf96a14964df1694ed470cc0395ef832 |
Close
Hashes for kgt-0.4.2-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cf9522727a25205803fef326b753d8074fccf3bcfc7b82d3a06074c1ba3a4080 |
|
MD5 | 580b913639192cc586eb37871305ee44 |
|
BLAKE2b-256 | fd69e96a754a188234c69f3ba7d84612191ac89541d9bf43cedc9c30b0843e77 |
Close
Hashes for kgt-0.4.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ddf5335492d98031dfc5f3fed09c98cd2fad1659cffb738f7dd22e5c0fad7848 |
|
MD5 | e119b2df3c79f3d2d2ca65697c6be8a3 |
|
BLAKE2b-256 | 0f126f87034bf819dee908ef0ece534e5a9f159ee8bfa836098ce6f53182d64a |
Close
Hashes for kgt-0.4.2-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5172ba11de8afd964e25c2740683bde24c6dcbe063a81ef9b1b93960a73f37a7 |
|
MD5 | 82945362b1959594959774e6ede97d40 |
|
BLAKE2b-256 | 8885327a55e9baad8934c5aa9af7fcb9d8a99e9cf44ff0411f6859e228831776 |
Close
Hashes for kgt-0.4.2-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7f919379f38ecc4db7e6c57dcd08265225656a9b3468ba7f8f26d79ea7c1903e |
|
MD5 | bd5bf06a567533f76d1e0a1135aca5e8 |
|
BLAKE2b-256 | b22c72d3a08fadd33ed913029f0591469ce6e577277c982b7efec7a9aa193831 |
Close
Hashes for kgt-0.4.2-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 56a08741cb2718c27b03f5c79c76fbcb9f38fa413af0e1ae6616c15a0d778885 |
|
MD5 | ecfc0ecfd776bb893487d61e0ec52b03 |
|
BLAKE2b-256 | 984b536a2502749192310e897bc3674afc5dbe528631e5fdc26c635aeedf7374 |
Close
Hashes for kgt-0.4.2-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c71277e65a27ac2814e12163d229893eeadf38975f47e2be5d8765ddbdc26be8 |
|
MD5 | fdad5d22ae12bb53a3df41aae0b82c34 |
|
BLAKE2b-256 | 76f338d75ef59361a48916063bd72e7c18351fc8bde15af1dc9716589fb5c558 |