-
Notifications
You must be signed in to change notification settings - Fork 0
Installation
The Convert Python SDK is published to PyPI as convert-python-sdk and
imports as convert_sdk. The two names differ by design — the hyphenated
name is the PyPI discoverability surface; the snake_case name is the ergonomic
import path.
| Requirement | Version |
|---|---|
| Python | >=3.9 |
httpx (bundled transport) |
>=0.28,<1.0 |
| Operating system | Linux, macOS, Windows (any platform CPython supports) |
httpx is the SDK's only runtime dependency and is only used in sdk_key
(remote-config) mode. There is no Django, Flask, FastAPI, pydantic, mmh3,
or JavaScript runtime dependency in the core distribution. The SDK works in any
standard Python process: WSGI/ASGI handlers, Lambda functions, Celery workers,
CLI scripts.
pip install convert-python-sdkuv add convert-python-sdkpoetry add convert-python-sdkFor reproducible builds, pin to a compatible-release range rather than an exact version:
# pyproject.toml
[project]
dependencies = [
"convert-python-sdk>=0.1,<0.2",
]The SDK follows Semantic Versioning. 0.x releases may
contain breaking changes between minor versions; 1.x and beyond hold
backwards-compatibility within each major.
python -c "import convert_sdk; print(convert_sdk.__version__)"Expected output: 0.1.0 (or the installed version).
Pre-release builds (alpha, beta, rc) are tagged on PyPI. To install the latest pre-release:
pip install --pre convert-python-sdkEverything in the table below is importable directly from the top-level
convert_sdk package. These are the only exports the SDK guarantees as stable
public API.
from convert_sdk import (
# Entry points
Core,
Context,
# Initialization config
SDKConfig,
TransportConfig,
RefreshConfig, # opt-in automatic config refresh (Phase 2)
# Typed evaluation results
ExperienceResult,
FeatureResult,
FeatureStatus,
ConversionResult,
ConversionStatus,
CustomSegmentsResult,
# Diagnostic surface
DiagnosticReason,
ExperienceDiagnostic,
FeatureDiagnostic,
GoalDiagnostic,
EntityDiagnostic,
# Lifecycle events
LifecycleEvent,
# Persistence boundary
DataStore, # Protocol — type-annotate your own adapter against this
InMemoryDataStore, # default adapter (used when SDKConfig.data_store is None)
# Error hierarchy
ConvertSDKError,
ConfigError,
InvalidConfigError,
ConfigLoadError,
TransportError,
TrackingDeliveryError,
# SDK version
__version__,
)These are stable for direct import by authors implementing custom adapters. They are not re-exported at the top level by design.
# Transport Protocol — implement this to swap in your own HTTP client
from convert_sdk.ports.transport import Transport
# EventBus Protocol and handler type — implement to substitute the event bus
from convert_sdk.ports.event_bus import EventBus, EventHandlerFor most applications, only a handful of names are needed:
from convert_sdk import Core, SDKConfigEverything else can be imported on demand as your usage expands.
If you cannot use httpx (corporate proxy, mTLS, custom retry policy), implement
the Transport Protocol with your own HTTP client and inject it into Core:
from convert_sdk import Core, SDKConfig
from convert_sdk.ports.transport import Transport
class MyTransport: # structural — no subclassing needed
def fetch_config(self, config: SDKConfig) -> dict: ...
def send_tracking(self, config: SDKConfig, payload: dict) -> None: ...
def close(self) -> None: ...
core = Core(SDKConfig(sdk_key="..."), transport=MyTransport()).initialize()The SDK has no hard dependency on httpx at evaluation time — httpx is
only used by the bundled adapter. See Extending for the full
protocol contract and injection patterns.
- Quickstart — first variation in 5 minutes
-
Initialization —
sdk_keyvs. direct config,RefreshConfig -
Configuration — full
SDKConfigoptions reference - Extending — custom transport, storage, and event-bus adapters
Copyrights © 2025 All Rights Reserved by Convert Insights, Inc.
Getting Started
Python SDK
- Quickstart
- Installation
- Initialization
- Configuration
- Code Examples
- Type Hints
- Diagnostics
- Extending
- Testing
- Async & Frameworks
Migration
Core Concepts
- Experiences & Variations
- Feature Flags
- Bucketing Algorithm
- Rule Evaluation
- Segments
- Data Management
- Event System
- API Communication
How-To Guides
- Running Experiences
- Running Features
- Tracking Conversions
- Visitor Context
- Persistent DataStore
- Troubleshooting
Edge & Integrations
Maintainers