Skip to content
IForevents Docs
IForevents Docs
HomeDashboardGitHubPrivacyTermsSecurityIntroduction
Support and SLA

Python SDK

Install iforevents, identify users, track events and add adapters from Python

pip install iforevents
pip install "iforevents[mixpanel]"   # extras: mixpanel, amplitude, segment, posthog, all
from iforevents import Iforevents, IForeventsAPIIntegration

iforevents = Iforevents([IForeventsAPIIntegration(project_key="pk_...")])
iforevents.init()

iforevents.identify("user_123", {"email": "[email protected]", "plan": "pro"})
iforevents.track("invoice_paid", {"amount": 120, "currency": "USD"})
iforevents.page("/pricing")
iforevents.reset()      # logout
iforevents.shutdown()   # also registered with atexit

Standard library only; batches on a background timer, retries transient failures, drains at exit. Every request carries X-User-Id (a generated anon_... id until identify). FileStorage(path) keeps the id and the queue across runs for CLIs.

Adapters

from iforevents.integrations.mixpanel import MixpanelIntegration
from iforevents.integrations.segment import SegmentIntegration

iforevents = Iforevents([
    IForeventsAPIIntegration(project_key="pk_..."),
    MixpanelIntegration(token="..."),
    SegmentIntegration(write_key="..."),
])

Options

base_url, batch_size (20, max 500, 1 = immediate), flush_interval (10 s), timeout, max_retries / retry_delay (Retry-After honored), requeue_failed_events, storage / persist_queue, throw_on_error, on_quota_exceeded, on_error, flush_at_exit. Errors: IForeventsAPIError, IForeventsAuthError, IForeventsQuotaExceededError, IForeventsRateLimitedError.

Source: iforevents-sdks/python. For a raw client of every endpoint see the generated libraries.

On this page

AdaptersOptions