PenguinTech License Server Python client
Project description
Penguin Tech License Client
PenguinTech License Server Python client for license validation and feature gating.
Installation
pip install penguin-licensing
# With Flask extras
pip install penguin-licensing[flask]
Usage
Basic License Validation
from penguin_licensing import LicenseClient
# Initialize client
client = LicenseClient(
license_key="PENG-XXXX-XXXX-XXXX-XXXX-ABCD",
product="elder"
)
# Validate license
info = client.validate()
print(f"License valid: {info.valid}")
print(f"Customer: {info.customer}")
print(f"Tier: {info.tier}")
Feature Gating
from penguin_licensing import get_license_client
client = get_license_client()
# Check specific feature
if client.check_feature("advanced_analytics"):
# Feature is available
pass
# Check tier requirement
if client.check_tier("enterprise"):
# Has enterprise license or higher
pass
Flask Integration
from flask import Flask
from penguin_licensing.decorators import license_required, feature_required
app = Flask(__name__)
@app.route('/api/v1/enterprise-feature')
@license_required('enterprise')
def enterprise_endpoint():
return {"message": "Enterprise feature"}
@app.route('/api/v1/analytics')
@feature_required('advanced_analytics')
def analytics_endpoint():
return {"data": "analytics"}
Environment Variables
LICENSE_KEY=PENG-XXXX-XXXX-XXXX-XXXX-ABCD
PRODUCT_NAME=elder
LICENSE_SERVER_URL=https://license.penguintech.io
Development
# Install dev dependencies
pip install -e ".[dev]"
# Run tests
pytest
# Format code
black src tests
ruff check src tests
# Type check
mypy src
License
AGPL-3.0 - See LICENSE for details.
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 Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file penguin_licensing-0.1.0.tar.gz.
File metadata
- Download URL: penguin_licensing-0.1.0.tar.gz
- Upload date:
- Size: 11.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
58dba3c178f609e511e88db69963a26eeaf15de506f713ffa66772463829e686
|
|
| MD5 |
c53f496557d81886c4248ff86cbc406d
|
|
| BLAKE2b-256 |
aec7b10a10fc1e4b3df93c5eff3bc6af78c1b8ffc8b9f2d026f0de5a1317f01d
|
Provenance
The following attestation bundles were made for penguin_licensing-0.1.0.tar.gz:
Publisher:
publish.yml on penguintechinc/penguin-libs
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
penguin_licensing-0.1.0.tar.gz -
Subject digest:
58dba3c178f609e511e88db69963a26eeaf15de506f713ffa66772463829e686 - Sigstore transparency entry: 942218603
- Sigstore integration time:
-
Permalink:
penguintechinc/penguin-libs@c9a052ab806abf7593b59ddc7a4ec5363be5cd2a -
Branch / Tag:
refs/heads/main - Owner: https://github.com/penguintechinc
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@c9a052ab806abf7593b59ddc7a4ec5363be5cd2a -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file penguin_licensing-0.1.0-py3-none-any.whl.
File metadata
- Download URL: penguin_licensing-0.1.0-py3-none-any.whl
- Upload date:
- Size: 9.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8cc33381eb9450081a15607439a9506f27867c97eabaa8820b006607de35950f
|
|
| MD5 |
ddee007af4ad8312ece89ae671d24a2a
|
|
| BLAKE2b-256 |
16c59a82fbf70e3c09754b9445382b86ea19382093a223eb5032d839e0f22a44
|
Provenance
The following attestation bundles were made for penguin_licensing-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on penguintechinc/penguin-libs
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
penguin_licensing-0.1.0-py3-none-any.whl -
Subject digest:
8cc33381eb9450081a15607439a9506f27867c97eabaa8820b006607de35950f - Sigstore transparency entry: 942218606
- Sigstore integration time:
-
Permalink:
penguintechinc/penguin-libs@c9a052ab806abf7593b59ddc7a4ec5363be5cd2a -
Branch / Tag:
refs/heads/main - Owner: https://github.com/penguintechinc
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@c9a052ab806abf7593b59ddc7a4ec5363be5cd2a -
Trigger Event:
workflow_dispatch
-
Statement type: