Installation
Install the Statly Observe SDK for Python applications.
Package Installation
pip install statly-observeRequirements
- Python 3.8 or higher
requestslibrary (installed automatically)
Basic Setup
Initialize the SDK as early as possible:
from statly_observe import Statly
Statly.init(
dsn='https://[email protected]/your-org',
environment='production',
)Get your DSN from Dashboard → Settings → SDK Setup.
Verify Installation
Test that events are being sent:
from statly_observe import Statly
Statly.init(dsn='https://[email protected]/your-org')
Statly.capture_message('SDK installed successfully', level='info')Check your Statly dashboard to see the test event.
With Exception Hook
Automatically capture uncaught exceptions:
from statly_observe import Statly
Statly.init(
dsn='https://[email protected]/your-org',
)
# The SDK automatically installs sys.excepthook
# All unhandled exceptions will be capturedType Hints
The SDK includes type hints for better IDE support:
from statly_observe import Statly
Statly.init(
dsn='https://[email protected]/your-org',
environment='production',
debug=True,
)
# User context with type hints
Statly.set_user(
id='user_123',
email='[email protected]',
)