Lightweight Python package analytics SDK
Project description
Klyne Python SDK
Lightweight Python package analytics SDK for Klyne. Track package usage, Python version adoption, OS distribution, and more with minimal overhead.
Features
- =� Lightweight: Zero dependencies, uses only Python standard library
- � Non-blocking: Asynchronous data transmission in background threads
- = Privacy-first: No PII collection, only aggregated usage metrics
- =� Robust: Graceful error handling and automatic retries
- =� Rich insights: Python versions, OS distribution, environment detection
- <� Simple API: One-line integration with sensible defaults
Installation
pip install klyne
Quick Start 💨
import klyne
# Initialize once in your package
klyne.init(
api_key="klyne_your_api_key_here",
project="your-package-name",
package_version="1.0.0"
)
# That's it! Analytics are automatically collected
What Gets Tracked
The SDK automatically collects:
- Python Environment: Version, implementation (CPython/PyPy)
- Operating System: Type, version, architecture
- Installation Context: pip/conda, virtual environment detection
- Hardware: CPU count, memory (rounded for privacy)
- Package Info: Name, version, entry points used
No personally identifiable information is collected.
Advanced Usage
Custom Event Tracking (coming soon)
import klyne
# Track specific functions or features
klyne.track_event(
entry_point="advanced_feature",
extra_data={"mode": "premium", "user_type": "enterprise"}
)
Configuration Options
import klyne
klyne.init(
api_key="klyne_your_api_key_here",
project="your-package-name",
package_version="1.0.0",
base_url="https://www.klyne.dev", # Default API URL
enabled=True, # Enable/disable analytics
debug=False # Debug logging
)
Environment-based Control
import os
import klyne
# Disable in development
enabled = os.getenv("ENVIRONMENT") == "production"
klyne.init(
api_key=os.getenv("KLYNE_API_KEY"),
project="your-package-name",
enabled=enabled
)
Manual Control
import klyne
# Disable analytics
klyne.disable()
# Re-enable analytics
klyne.enable()
# Check status
if klyne.is_enabled():
print("Analytics are active")
# Flush pending events (useful for short-lived scripts)
klyne.flush(timeout=5.0)
Requirements
- Python 3.7+
- No external dependencies
- Internet connection (for sending analytics)
License
MIT License
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 klyne-0.1.96a2.tar.gz.
File metadata
- Download URL: klyne-0.1.96a2.tar.gz
- Upload date:
- Size: 13.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b425c39f267921c8ecb363bba30b1bab4d27d21bfad0bf5c5956b118c5762ce5
|
|
| MD5 |
dc06b0427f9a98b3c437b966b25ca1af
|
|
| BLAKE2b-256 |
6484807c9fd1e32baab6c01c56c2d886d0e0579822c75f0d7b4c06945e168297
|
Provenance
The following attestation bundles were made for klyne-0.1.96a2.tar.gz:
Publisher:
publish-sdk.yml on psincraian/klyne
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
klyne-0.1.96a2.tar.gz -
Subject digest:
b425c39f267921c8ecb363bba30b1bab4d27d21bfad0bf5c5956b118c5762ce5 - Sigstore transparency entry: 660733856
- Sigstore integration time:
-
Permalink:
psincraian/klyne@85ca2c20c2991acc55f718de079977421f6bf666 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/psincraian
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-sdk.yml@85ca2c20c2991acc55f718de079977421f6bf666 -
Trigger Event:
push
-
Statement type:
File details
Details for the file klyne-0.1.96a2-py3-none-any.whl.
File metadata
- Download URL: klyne-0.1.96a2-py3-none-any.whl
- Upload date:
- Size: 12.7 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 |
a75859fd2da37e87fd5ac0d282f8876b53ac4d0db4db150b9f975f525ce5f2c5
|
|
| MD5 |
795e75fbeb88ef0c6513c0005a492d75
|
|
| BLAKE2b-256 |
4fe8260de9055d6e28b8b72878979b07bfac368d23bf39996bb0433abcfe5fa8
|
Provenance
The following attestation bundles were made for klyne-0.1.96a2-py3-none-any.whl:
Publisher:
publish-sdk.yml on psincraian/klyne
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
klyne-0.1.96a2-py3-none-any.whl -
Subject digest:
a75859fd2da37e87fd5ac0d282f8876b53ac4d0db4db150b9f975f525ce5f2c5 - Sigstore transparency entry: 660733858
- Sigstore integration time:
-
Permalink:
psincraian/klyne@85ca2c20c2991acc55f718de079977421f6bf666 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/psincraian
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-sdk.yml@85ca2c20c2991acc55f718de079977421f6bf666 -
Trigger Event:
push
-
Statement type: