Composio Core

0.7.21 · deprecated · verified Wed Apr 15

Composio Core was the foundational Python package acting as a bridge between the Composio platform and other services. It is now officially DEPRECATED. Users are strongly advised to migrate to the 'composio' package for all new and existing projects, which offers improved performance, enhanced developer experience, and continued support. The 'composio' library is actively maintained with frequent updates and a clear release cadence.

Warnings

Install

Imports

Quickstart

This quickstart demonstrates the recommended way to initialize and verify connectivity with the Composio platform using the 'composio' library. It fetches available tools for a specified user ID and requires `COMPOSIO_API_KEY` to be set as an environment variable. This example showcases the basic setup for interacting with Composio's toolkit management features.

import os
from composio import Composio

# Ensure COMPOSIO_API_KEY is set in your environment variables
# (e.g., in a .env file or directly in your shell)
composio = Composio(
    api_key=os.environ.get('COMPOSIO_API_KEY', '')
)

def verify_connection():
    try:
        # 'user-id-123' should be a unique identifier for your user
        # Toolkits specifies which sets of tools to load (e.g., HACKERNEWS, GITHUB)
        tools = composio.tools.get(user_id='user-id-123', toolkits=['HACKERNEWS'])
        print(f"Successfully connected! Found {len(tools)} tools.")
    except Exception as error:
        print(f"Connection failed: {error}")

if __name__ == '__main__':
    verify_connection()

view raw JSON →