Python adapter SDK for emitting events to the Morphe Control Plane
Project description
morphe-adapter-sdk
Python adapter SDK for emitting events to the Morphe Control Plane.
Installation
pip install morphe-adapter-sdk
Quick start
import asyncio
from morphe_adapter_sdk import MorpheClient
async def main():
async with MorpheClient(token="your-token") as client:
result = await client.emit({
"event_type": "dataops.v1.sync_failed",
"system_id": "your-system-uuid",
"payload": {"records_failed": 42, "source": "warehouse"},
})
print(result)
asyncio.run(main())
Configuration
| Parameter | Type | Default | Description |
|---|---|---|---|
token |
str |
required | API token from your Morphe workspace |
hmac_secret |
str |
None |
Optional HMAC secret for request signing |
validate_schema |
bool |
False |
Validate payload against event schema before emit |
endpoint |
str |
https://api.morphe.io |
Override for self-hosted deployments |
max_retries |
int |
3 |
Number of retries on transient network errors |
Error handling
from morphe_adapter_sdk import MorpheClient
from morphe_adapter_sdk.errors import ApiError, NetworkError, SchemaValidationError
async with MorpheClient(token="your-token") as client:
try:
await client.emit(event)
except SchemaValidationError as e:
print("Schema errors:", e.errors)
except ApiError as e:
print(f"API error {e.status_code}: {e.message}")
except NetworkError as e:
print("Network error:", e)
License
MIT
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
morphe_adapter_sdk-1.0.3.tar.gz
(10.5 kB
view details)
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 morphe_adapter_sdk-1.0.3.tar.gz.
File metadata
- Download URL: morphe_adapter_sdk-1.0.3.tar.gz
- Upload date:
- Size: 10.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: Hatch/1.16.5 cpython/3.12.12 HTTPX/0.28.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
55d9b84b627a4532444287e819eff6ec3703c511687922528de0585d417284ff
|
|
| MD5 |
d62905c6789255461e46460c143d4aea
|
|
| BLAKE2b-256 |
663aa4ec8d37b39fbf7c9b9136db2d5d38994e8ec9f6408b3fb77e4c3d754084
|
File details
Details for the file morphe_adapter_sdk-1.0.3-py3-none-any.whl.
File metadata
- Download URL: morphe_adapter_sdk-1.0.3-py3-none-any.whl
- Upload date:
- Size: 9.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: Hatch/1.16.5 cpython/3.12.12 HTTPX/0.28.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
83bd68eadce0d7bf2cd5e9fa22222579b7d51e052f78ce77bc2880cba9daef82
|
|
| MD5 |
e20563ae7a76ad69a3676a7aa217f2b9
|
|
| BLAKE2b-256 |
a13bd027c9c113a9126bb392e905600a43be59787e541e3fe4ae40673af97da9
|