Skip to main content
Flare has a Python SDK available on PyPI. It is a light wrapper around requests that automatically manages API authentication.

Installing

Basic Usage

The flareio package provides the FlareApiClient class, which automatically manages authentication and exposes get, post, put, and delete methods.
Basic Usage Example

Creating a client from environment variables

The Flare SDK automatically recognizes the FLARE_API_KEY and FLARE_TENANT_ID environment variables. For example, you may expose the following environment variables, and then create an API client from them:

Paging Util - Generic

The FlareApiClient has a scroll method that can be used with endpoints that support the Flare standard paging pattern .
Paging Util - Generic Example

Paging Util - Event Feeds

The FlareApiClient has a scroll_events method that can be used with event feeds endpoints. The advantage of this method over scroll is that it also automates the fetching of individual events.
Paging Util - Event Feeds Example

Custom Session

The FlareApiClient can be initialized with a custom requests.Session. This allows, for example, to inject custom retry configuration.
Custom Session