Skip to main content

Official Python SDK for FlowMyna - Process Mining Event Tracking

Project description

FlowMyna Python SDK

Official Python SDK for FlowMyna - Process Mining Event Tracking.

Installation

pip install flowmyna

Or with your preferred package manager:

uv add flowmyna
poetry add flowmyna
pipenv install flowmyna

For async support with HTTP/2:

pip install flowmyna[async]

Quick Start

from flowmyna import FlowMyna

# Initialize the client
client = FlowMyna(api_key="fm_live_your_key_here")

# Record an event
client.record_event(
    event="Order Placed",
    objects=[
        {"type": "Order", "id": "ORD-123"},
        {"type": "Customer", "id": "CUST-456"}
    ],
    properties={"total": 149.99}
)

# Upsert an object
client.upsert_object(
    type="Customer",
    id="CUST-456",
    properties={
        "name": "Jane Doe",
        "email": "jane@example.com"
    }
)

Features

  • Simple API - Intuitive methods for recording events and managing objects
  • Batch Operations - Efficiently send up to 100 events/objects per request
  • Automatic Retries - Built-in retry logic with exponential backoff
  • Type Hints - Full type annotations for IDE support
  • Async Support - Optional async client for high-concurrency applications

Configuration

import os
from flowmyna import FlowMyna

# Using environment variable (recommended)
client = FlowMyna(api_key=os.environ["FLOWMYNA_API_KEY"])

# With custom configuration
client = FlowMyna(
    api_key="fm_live_xxx",
    timeout=60,          # 60 second timeout
    max_retries=5,       # Retry up to 5 times
)

Async Usage

import asyncio
from flowmyna import AsyncFlowMyna

async def main():
    async with AsyncFlowMyna(api_key="fm_live_xxx") as client:
        await client.record_event(
            event="Order Placed",
            objects=[{"type": "Order", "id": "ORD-123"}]
        )

asyncio.run(main())

Error Handling

from flowmyna import FlowMyna
from flowmyna.exceptions import (
    FlowMynaError,
    AuthenticationError,
    ValidationError,
    RateLimitError,
    ServerError
)

client = FlowMyna(api_key="fm_live_xxx")

try:
    client.record_event(
        event="Order Placed",
        objects=[{"type": "Order", "id": "ORD-123"}]
    )
except AuthenticationError:
    print("Invalid API key")
except ValidationError as e:
    print(f"Invalid request: {e}")
except RateLimitError as e:
    print(f"Rate limited, retry after: {e.retry_after}")
except ServerError:
    print("Server error, please retry")
except FlowMynaError as e:
    print(f"Unexpected error: {e}")

Documentation

Full documentation is available at flowmyna.com/api/sdks/python

License

MIT License - see LICENSE for details.

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

flowmyna-0.1.1.tar.gz (12.9 kB view details)

Uploaded Source

Built Distribution

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

flowmyna-0.1.1-py3-none-any.whl (13.4 kB view details)

Uploaded Python 3

File details

Details for the file flowmyna-0.1.1.tar.gz.

File metadata

  • Download URL: flowmyna-0.1.1.tar.gz
  • Upload date:
  • Size: 12.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.4

File hashes

Hashes for flowmyna-0.1.1.tar.gz
Algorithm Hash digest
SHA256 1221a6c61f87ad0a0075407319b26918a649ad964961b4622f119d0998b3ca0a
MD5 b9e58e748816f2885d6015dfa7002b1d
BLAKE2b-256 870edbc1d212132a1483c79a8dc9e6dd27856ea8587d14158e82838d7332575c

See more details on using hashes here.

File details

Details for the file flowmyna-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: flowmyna-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 13.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.4

File hashes

Hashes for flowmyna-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 2fe4ffbbe379e3c2e0566148f0eadbda5225cc1703677818e5e695991f148098
MD5 dfb268071a2aee860faf7a67179a7099
BLAKE2b-256 7a4b3ea65f3a6a373211f64fe30230b464936f3771b05be06742d4f0238a2a93

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