Skip to content

Installation

  • Python 3.8 or higher
  • Playwright 1.40.0 or higher
  • An active Clio account

Install the Clio SDK from PyPI using pip:

Terminal window
pip install clio_monitoring

Or if you’re using Poetry:

Terminal window
poetry add clio_monitoring

For development installations, you can install from source:

Terminal window
git clone https://github.com/TreebeardHQ/clio-python-sdk
cd clio-python-sdk
pip install -e .
  1. Sign up for Clio: If you don’t have an account, create one at app.cliomonitoring.com

  2. Access Your Dashboard: Log in and navigate to your organization’s dashboard

  3. Generate an API Key:

    • Go to SettingsAPI Keys
    • Click Generate New Key
    • Give your key a descriptive name (e.g., “Local Development”)
    • Copy the generated key (it starts with clio_)
  4. Store Securely: Save your API key in a secure location. You’ll need it to configure the SDK.

Create a simple test script to verify everything is working:

test_clio.py
from clio import ClioMonitor
# This should not raise any import errors
print("✅ Clio SDK imported successfully")
# Test configuration (replace with your actual API key)
try:
monitor = ClioMonitor(api_key="clio_test_key_validation_only")
print("✅ ClioMonitor created successfully")
except ValueError as e:
if "Invalid API key format" in str(e):
print("✅ API key validation working")
else:
print(f"❌ Unexpected error: {e}")

Run the test:

Terminal window
python test_clio.py

You should see:

✅ Clio SDK imported successfully
✅ API key validation working

For security, store your API key as an environment variable:

Terminal window
export CLIO_API_KEY="your_actual_api_key_here"
Terminal window
set CLIO_API_KEY=your_actual_api_key_here
Terminal window
$env:CLIO_API_KEY="your_actual_api_key_here"

Create a .env file in your project root:

.env
CLIO_API_KEY=your_actual_api_key_here

Then load it in your Python code:

from dotenv import load_dotenv
import os
load_dotenv()
api_key = os.getenv("CLIO_API_KEY")

The Clio SDK works with Playwright’s video recording feature. Make sure you have Playwright installed and browsers downloaded:

Terminal window
# Install Playwright
pip install playwright
# Download browser binaries
playwright install

Now that you have the SDK installed and your API key ready, you can start monitoring your first automation:

If you get import errors, make sure:

  • You’re using Python 3.8 or higher: python --version
  • The SDK is installed in the correct environment: pip list | grep clio_monitoring
  • You’re activating the right virtual environment

If you have trouble with API keys:

  • Ensure the key starts with clio_
  • Check for extra spaces or newlines when copying
  • Verify the key is active in your Clio dashboard
  • Make sure you’re using the API key, not your login password

If you get permission errors during installation:

Terminal window
pip install --user clio_monitoring

Or use a virtual environment:

Terminal window
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
pip install clio_monitoring