or run

tessl search
Log in

Version

Workspace
tessl
Visibility
Public
Created
Last updated
Describes
pypipkg:pypi/posthog@6.7.x
tile.json

tessl/pypi-posthog

tessl install tessl/pypi-posthog@6.7.0

Integrate PostHog into any python application.

Agent Success

Agent success rate when using this tile

89%

Improvement

Agent success rate improvement when using this tile compared to baseline

1.03x

Baseline

Agent success rate without this tile

86%

task.mdevals/scenario-9/

Event Queue Manager

A Python script that manages analytics event collection with proper queue lifecycle management.

Capabilities

Initialize analytics client

  • Initializes an analytics client with custom queue settings: batch size of 50 events and flush interval of 2 seconds @test

Capture and queue events

  • Captures 75 analytics events for a user with distinct_id "user_123" including page views, button clicks, and form submissions @test

Force flush queued events

  • Forces immediate flush of all 30 queued events before the automatic flush interval triggers @test

Clean shutdown with remaining events

  • Captures 20 events, then calls cleanup to ensure all events are sent and threads are stopped before program exit @test

Implementation

@generates

API

def initialize_client(api_key: str) -> None:
    """
    Initialize the analytics client with custom queue configuration.
    Sets batch size to 50 events and flush interval to 2 seconds.

    Args:
        api_key: The project API key for authentication
    """
    pass

def capture_events(user_id: str, event_count: int) -> None:
    """
    Capture multiple analytics events for a user.
    Creates a mix of different event types.

    Args:
        user_id: The distinct user identifier
        event_count: Number of events to capture
    """
    pass

def force_flush() -> None:
    """
    Force all queued events to be sent immediately.
    """
    pass

def cleanup() -> None:
    """
    Properly shut down the client, ensuring all events are sent
    and all resources are cleaned up.
    """
    pass

Dependencies { .dependencies }

posthog { .dependency }

Provides analytics tracking with queue management capabilities.

@satisfied-by