Skip to main content

Lightweight Python package analytics SDK

Project description

Klyne Python SDK

PyPI version Python Support License: MIT

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


Get your free API key at klyne.dev

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

klyne-0.1.0a146.tar.gz (13.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

klyne-0.1.0a146-py3-none-any.whl (12.7 kB view details)

Uploaded Python 3

File details

Details for the file klyne-0.1.0a146.tar.gz.

File metadata

  • Download URL: klyne-0.1.0a146.tar.gz
  • Upload date:
  • Size: 13.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for klyne-0.1.0a146.tar.gz
Algorithm Hash digest
SHA256 57f1a13fa8a681caee1b1b99aaedc39ad667ebbb5a26348fb84807c96df0c54c
MD5 ae5ea5315775b148f2d4c8382a552d04
BLAKE2b-256 b49848e24e03437ab655907aacedb1165e5cb89ed9dd1a8df9d031ee7f158d03

See more details on using hashes here.

Provenance

The following attestation bundles were made for klyne-0.1.0a146.tar.gz:

Publisher: publish-sdk.yml on psincraian/klyne

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file klyne-0.1.0a146-py3-none-any.whl.

File metadata

  • Download URL: klyne-0.1.0a146-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

Hashes for klyne-0.1.0a146-py3-none-any.whl
Algorithm Hash digest
SHA256 06b99272558f47e57729df4fc3ff4f428af20093070bb177d618d513ee94ce85
MD5 b0599d1af6e0a052c471d86e5ddb3e17
BLAKE2b-256 0f05a9ff0d95b9f1336c6d1ce602d4a6fdf56a9186b8221426ab1df87539e461

See more details on using hashes here.

Provenance

The following attestation bundles were made for klyne-0.1.0a146-py3-none-any.whl:

Publisher: publish-sdk.yml on psincraian/klyne

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page