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
Metadata
Release files for ekaros-sdk 0.1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| ekaros_sdk-0.1.2.tar.gz | 21.5 kB | Without provenance | Details for ekaros_sdk-0.1.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| ekaros_sdk-0.1.2-py3-none-any.whl | Python 3 | none | any | Details for ekaros_sdk-0.1.2-py3-none-any.whl |
Total release size: 45.2 kB
Release files / ekaros_sdk-0.1.2.tar.gz
| Download URL | ekaros_sdk-0.1.2.tar.gz |
|---|---|
| Size | 21.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7141b300d3fc16194e3ec177ff236d3b873447bac6f5ad544e89e05515be2950
|
|
BLAKE2b-256 checksum How to use checksums |
af49dc9c4cddfa250d2d34748df9e38b6d7039fc7aee207c5c7b7a1c2bb430fa
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.5
|
Release files / ekaros_sdk-0.1.2-py3-none-any.whl
| Download URL | ekaros_sdk-0.1.2-py3-none-any.whl |
|---|---|
| Size | 23.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
5542aabd5c2a9d8653316a56dd7dbac21be45de3aa0307944501694a0b016a3b
|
|
BLAKE2b-256 checksum How to use checksums |
787d1c22b0895ccf74388f02dc083586485d6e3bf17eed5bdd2aec0d59bd3e25
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.5
|
Security for ekaros-sdk 0.1.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.