Installation
To install the ActivitySmith Python SDK, you can use pip:Python
Usage
- Get an API key from ActivitySmith
- Set the API key as an environment variable named
ACTIVITYSMITH_API_KEYor pass it as a parameter to theActivitySmithclass.
Python
Send a Push Notification
Useactivitysmith.notifications.send_push_notification with a push_notification_request payload. title is required; message and subtitle are optional.
Python
Start a Live Activity
Start a Live Activity withactivitysmith.live_activities.start_live_activity. For a segmented progress activity, include title, number_of_steps, current_step, and type.
Python
Update a Live Activity
Update a Live Activity withactivitysmith.live_activities.update_live_activity. The content_state requires at least title and current_step.
Python
End a Live Activity
End a Live Activity withactivitysmith.live_activities.end_live_activity. You can optionally set auto_dismiss_minutes in the content_state.
Python
Error Handling
The SDK raises exceptions for non-2xx responses. Rate limit errors use theerror and message fields, and Live Activity limits include limit and active. See Rate Limits for details.