Quick Start¶
This guide will get you up and running with QuantumMeta License Manager in minutes.
For End Users¶
1. Check Your System¶
First, let's see your machine information:
2. Activate a License (if you have one)¶
If you received a .qkey
license file:
3. Check License Status¶
Verify your license is working:
4. Use in Python Code¶
from quantummeta_license import validate_or_grace
# This will either validate your license or start a 7-day grace period
def my_function():
validate_or_grace("quantum-metalearn")
print("Access granted!")
# Your code here
my_function()
For Package Developers¶
1. Integrate License Checking¶
Add this to your package's __init__.py
:
from quantummeta_license import validate_or_grace, LicenseError
def _check_license():
try:
validate_or_grace("your-package-name")
except LicenseError as e:
print(f"License Error: {e}")
# Handle gracefully or exit
# Check license on import
_check_license()
2. Feature-Gated Functions¶
from quantummeta_license import validate_or_grace, FeatureNotLicensedError
def basic_feature():
validate_or_grace("your-package")
return "Basic functionality"
def premium_feature():
try:
validate_or_grace("your-package", required_features=["pro"])
return "Premium functionality unlocked!"
except FeatureNotLicensedError:
return "This feature requires a Pro license"
For License Administrators¶
1. Generate a License¶
quantum-license generate \
--package "quantum-metalearn" \
--user "user@company.com" \
--features "core,pro" \
--days 365 \
--output license.qkey
2. Generate with Digital Signature¶
quantum-license generate \
--package "quantum-metalearn" \
--user "user@company.com" \
--features "core,pro,enterprise" \
--days 365 \
--sign \
--output signed-license.qkey
This creates both signed-license.qkey
and signed-license.pub
(public key).
Development Mode¶
For development and testing, bypass all license checks:
# Unix/Linux/macOS
export QUANTUMMETA_DEV=1
# Windows PowerShell
$env:QUANTUMMETA_DEV = "1"
# Windows CMD
set QUANTUMMETA_DEV=1
Now all license validations will return True
immediately.
Common Workflows¶
New User Experience¶
- User installs your package:
pip install quantum-metalearn
- User imports/uses package → 7-day grace period starts automatically
- User sees grace period notifications with remaining time
- After 7 days, user must activate a license to continue
Licensed User Experience¶
- User receives
.qkey
file from you - User runs:
quantum-license activate license.qkey
- User can now use the package indefinitely (until license expires)
- License is tied to their specific machine
Enterprise Deployment¶
- IT admin generates licenses for each machine/user
- Licenses are distributed and activated on target machines
- Applications work seamlessly with validated licenses
- Development machines use
QUANTUMMETA_DEV=1
for testing
Troubleshooting¶
Grace Period Issues¶
Check grace period status:
Reset grace period (testing only):
from quantummeta_license.core.usage_tracker import UsageTracker
tracker = UsageTracker()
tracker.clear_usage_data("your-package-name")
License Activation Problems¶
Common issues: - Wrong machine: License is tied to a different machine - Expired license: Check expiration date - Corrupted file: Re-download the license file
Check detailed status:
Development Setup¶
Make sure development mode is working:
from quantummeta_license.core.validation import is_development_mode
print(f"Dev mode: {is_development_mode()}")
Next Steps¶
- CLI Reference - Complete command documentation
- Integration Guide - Advanced integration patterns
- License Format - Understanding license structure
- Security - Security considerations and best practices