Skip to content

Paradox

flowtask.components.Paradox

Paradox

Paradox(loop=None, job=None, stat=None, **kwargs)

Bases: HTTPService, CacheSupport, FlowComponent

Paradox Component

Overview

This component interacts with the Paradox API to perform various operations. The first step is to handle authentication and obtain an access token. The token is cached in Redis to avoid requesting a new one on each execution.

.. table:: Properties :widths: auto

+----------------------------+----------+----------------------------------------------------------------------------------------------+ | Name | Required | Summary | +----------------------------+----------+----------------------------------------------------------------------------------------------+ | type | Yes | Type of operation to perform with the API | +----------------------------+----------+----------------------------------------------------------------------------------------------+

candidates async

candidates()

Retrieves candidates from Paradox API using efficient pandas operations. Uses pagination to fetch all available candidates up to the maximum offset. Includes a delay between requests to avoid API rate limits.

Kwargs

offset_start (int): Starting offset for pagination (default: 0)

Returns:

Type Description
DataFrame

pd.DataFrame: DataFrame containing candidate information

Raises:

Type Description
ComponentError

If the request fails or returns invalid data

close async

close()

Cleanup any resources

get_cached_token async

get_cached_token()

Retrieves the cached authentication token from Redis if it exists.

run async

run()

Execute the main component logic based on the specified type. Currently supports authentication as the initial implementation.

set_auth_headers

set_auth_headers(token)

Set authentication token and headers

start async

start(**kwargs)

Initialize the component and authenticate with the API. Handles authentication flow including token caching in Redis.