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
Release history Release notifications | RSS feed
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.0.tar.gz
(13.0 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
flowmyna-0.1.0-py3-none-any.whl
(13.5 kB
view details)
File details
Details for the file flowmyna-0.1.0.tar.gz.
File metadata
- Download URL: flowmyna-0.1.0.tar.gz
- Upload date:
- Size: 13.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0c90bdc007b0a56a4d341b99d0052bc9d802acf32b740f0c4b5151f0b86d52c4
|
|
| MD5 |
01b6a755f31102fe2416f3fbfbc83bdd
|
|
| BLAKE2b-256 |
a76fa8c5d4372fdc22b70698c1a2d04d984f7f230c7046c0a987078dd25531a5
|
File details
Details for the file flowmyna-0.1.0-py3-none-any.whl.
File metadata
- Download URL: flowmyna-0.1.0-py3-none-any.whl
- Upload date:
- Size: 13.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
aa7acae7838bcdc53bb08e82fa5bf65289b375a4259619143a9ecdc57f89bf4f
|
|
| MD5 |
95cf432900a270fe1a6135835cd75ade
|
|
| BLAKE2b-256 |
417770e4b39eba24829954638adc4484ac163977c7b716a3aa4688bf9738f2c6
|