Skip to main content

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)

Uploaded Source

Built Distribution

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

morphe_adapter_sdk-1.0.3-py3-none-any.whl (9.9 kB view details)

Uploaded Python 3

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

Hashes for morphe_adapter_sdk-1.0.3.tar.gz
Algorithm Hash digest
SHA256 55d9b84b627a4532444287e819eff6ec3703c511687922528de0585d417284ff
MD5 d62905c6789255461e46460c143d4aea
BLAKE2b-256 663aa4ec8d37b39fbf7c9b9136db2d5d38994e8ec9f6408b3fb77e4c3d754084

See more details on using hashes here.

File details

Details for the file morphe_adapter_sdk-1.0.3-py3-none-any.whl.

File metadata

File hashes

Hashes for morphe_adapter_sdk-1.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 83bd68eadce0d7bf2cd5e9fa22222579b7d51e052f78ce77bc2880cba9daef82
MD5 e20563ae7a76ad69a3676a7aa217f2b9
BLAKE2b-256 a13bd027c9c113a9126bb392e905600a43be59787e541e3fe4ae40673af97da9

See more details on using hashes here.

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