Ekaros SDK for API performance monitoring, A/B testing, and experimentation
Project description
Ekaros SDK
Ekaros Python SDK is the Python SDK to implement Ekaros Experiments on Python applications.
Features
- Performance Monitoring: Track API latency, memory usage, and response metrics
- A/B Journeys Testing: Run experiments with multiple variations
- Comprehensive Metrics: Capture request/response data, headers, and custom parameters
- Asynchronous Tracking: Non-blocking metrics collection
Supports
- Django
Installation
pip install ekaros-sdk
Quick Start
1. Initialize Ekaros in your Django project
In your Django urls.py:
from django.urls import path, include
from ekaros import Ekaros
# Initialize Ekaros with your SDK key
ekaros_instance = Ekaros(
framework="django",
sdk_key="your-sdk-key-here"
)
urlpatterns = [
path('admin/', admin.site.urls),
path('api/', include('your_app.urls')),
# Include Ekaros URLs
path('ekaros/', include(('ekaros.backends.django.urls', 'ekaros'), namespace='ekaros')),
]
# Load URL patterns into Ekaros
ekaros_instance.load_url_patterns(urlpatterns)
# Override with Ekaros-enhanced patterns
urlpatterns = ekaros_instance.get_urlpatterns()
2. Register Views for A/B Testing
All your existsing views in the urls will be automatically registered. If you want to register new Views, you can use:
@ekaros.register(name="my_app:checkout_view")
def checkout_view_v1(request):
return render(request, 'checkout_v1.html')
@ekaros.register(name="my_app:checkout_view")
def checkout_view_v2(request):
return render(request, 'checkout_v2.html')
@ekaros.register(name="ab_apis:simple_view")
class SimpleButtonView(View):
def get(self, request):
return JsonResponse({"response_data": "GET API from Simple View"})
def post(self, request):
return JsonResponse({"response_data": "POST API from Simple View"})
Configuration Options
When initializing Ekaros, you can pass the following options:
ekaros = Ekaros(
framework="django",
sdk_key="your-sdk-key",
instance_name="default", # For multiple instances
# Additional backend-specific options
)
Advanced Features
Client Token Generation
Generate tokens for client-side tracking:
token = ekaros.create_client_token(
custom_parameters={"user_id": "123"},
timeout=86400 # 24 hours
)
Metrics Collected
The SDK automatically tracks:
- Performance: Latency, memory allocation, peak memory
- Request Data: Headers, body, query parameters, method, path
- Response Data: Headers, body, status code, content type
- Experiment Data: A/B test variants, journey paths
- Error Tracking: Exception messages and stack traces
Requirements
- Python >= 3.8
- Django >= 5.0
- requests >= 2.25.0
Development
Install Development Dependencies
pip install -e ".[dev]"
Run Tests
pytest
Code Formatting
black ekaros/
flake8 ekaros/
Support
For issues, questions, or contributions:
- GitHub Issues: https://github.com/Anirudh-RV/ekaros-sdk-python/issues
- Documentation: https://ekaros.dev/documentation/human/sdk/python/
License
MIT License - see LICENSE file for details
Changelog
0.1.0 (2025-01-01)
- Initial release
- Django backend support
- Performance tracking
- A/B testing capabilities
- Dynamic routing
0.1.1 (2025-01-01)
- Shifting all names from Discerance to Ekaros
0.1.2 (2025-15-01)
- Continuing journey is an error occurs
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 ekaros_sdk-0.1.2.tar.gz.
File metadata
- Download URL: ekaros_sdk-0.1.2.tar.gz
- Upload date:
- Size: 21.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7141b300d3fc16194e3ec177ff236d3b873447bac6f5ad544e89e05515be2950
|
|
| MD5 |
7ee81444c101a0c063d4ade384623ee5
|
|
| BLAKE2b-256 |
af49dc9c4cddfa250d2d34748df9e38b6d7039fc7aee207c5c7b7a1c2bb430fa
|
File details
Details for the file ekaros_sdk-0.1.2-py3-none-any.whl.
File metadata
- Download URL: ekaros_sdk-0.1.2-py3-none-any.whl
- Upload date:
- Size: 23.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5542aabd5c2a9d8653316a56dd7dbac21be45de3aa0307944501694a0b016a3b
|
|
| MD5 |
dfda4792ff2d2d61639a56059d5ac5bf
|
|
| BLAKE2b-256 |
787d1c22b0895ccf74388f02dc083586485d6e3bf17eed5bdd2aec0d59bd3e25
|