Official Python SDK for Authon β Software Licensing & Authentication Platform
Create an account at authon.pro
Go to Dashboard β Apps β Create Application
Copy your App ID and API Key from App Settings
from authon import Authon
# Initialize with your credentials
auth = Authon ("your-app-id" , "your-api-key" )
auth .init ()
# Authenticate
result = auth .login ("username" , "password" )
if result ["success" ]:
print (f"Welcome { auth .username } ! Level: { auth .level } " )
print (f"Expires: { auth .expires_at } " )
else :
print (f"Error: { result ['message' ]} " )
# Use features
value = auth .get_var ("welcome_message" )
files = auth .list_files ()
auth .log ("Application started" )
# Logout when done
auth .logout ()
Method
Description
Authon(app_id, api_key)
Create SDK instance
init() β bool
Connect to API, validate credentials
Method
Description
login(username, password, hwid?) β dict
Login with credentials
license(key, hwid?) β dict
Authenticate with license key
register(username, password, license_key, hwid?) β dict
Create new account
check() β bool
Validate session (heartbeat)
logout() β bool
End session
Method
Description
get_var(key) β str
Get app-level variable
set_var(key, value) β bool
Set user-level variable
get_user_var(key) β str
Get user-level variable
Method
Description
list_files() β list
List available files for user's level
download_file(file_id) β bytes
Download file content
Method
Description
log(message) β bool
Send activity log
fetch_online() β dict
Get online user count/list
fetch_stats() β dict
Get app statistics
Method
Description
get_hwid() β str
Generate hardware ID
check_blacklist(ip?, hwid?) β dict
Check ban status
redeem_referral(code) β dict
Redeem referral code
Property
Type
Description
session_token
str
Active session token
username
str
Authenticated username
level
int
User access level
subscription
str
Subscription plan name
expires_at
str
Subscription expiry date
app_name
str
Application name
app_version
str
Application version
is_authenticated
bool
Whether user has active session
π Authentication Methods
Username + Password Login
result = auth .login ("username" , "password" )
if result ["success" ]:
# auth.session_token, auth.username, auth.level are now set
print (f"Level: { auth .level } " )
result = auth .license ("ABCDE-FGHIJ-KLMNO-PQRST" )
if result ["success" ]:
print (f"License valid! Level: { auth .level } " )
result = auth .register ("newuser" , "password123" , "LICENSE-KEY-HERE" )
if result ["success" ]:
print ("Account created! Now login:" )
auth .login ("newuser" , "password123" )
# List available files
files = auth .list_files ()
for f in files :
print (f" { f ['name' ]} ({ f ['size' ]} bytes) β Level { f ['minLevel' ]} " )
# Download a file
data = auth .download_file (files [0 ]["id" ])
if data :
with open (files [0 ]["name" ], "wb" ) as f :
f .write (data )
print (f"Downloaded { len (data )} bytes" )
π₯οΈ HWID (Hardware ID)
HWID is automatically generated from your system hardware. You don't need to handle it manually.
Windows : Disk serial number + computer name
macOS : Hardware UUID
Linux : /etc/machine-id
To override:
result = auth .login ("user" , "pass" , hwid = "custom-hwid-value" )
result = auth .login ("user" , "wrongpassword" )
if not result ["success" ]:
error = result ["message" ]
# Possible error messages:
# - "Invalid credentials"
# - "Account banned"
# - "Hardware ID mismatch"
# - "Subscription expired"
# - "Account is frozen. Contact admin to unfreeze."
# - "VPN/Proxy connections are not allowed"
# - "Application is paused"
# - "IP address banned"
print (f"Error: { error } " )
ποΈ Project Structure
python-Loader/
βββ authon.py # SDK source (single file, copy to your project)
βββ example.py # Full usage example
βββ requirements.txt # Dependencies (just 'requests')
βββ pyproject.toml # Package metadata
βββ README.md # This file
Python 3.8+
requests library (pip install requests)
MIT β Free to use in any project, commercial or personal.
Built with β€οΈ by Authon
The #1 KeyAuth Alternative