Paradox¶
flowtask.components.Paradox
¶
Paradox
¶
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
¶
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 |
get_cached_token
async
¶
Retrieves the cached authentication token from Redis if it exists.
run
async
¶
Execute the main component logic based on the specified type. Currently supports authentication as the initial implementation.
start
async
¶
Initialize the component and authenticate with the API. Handles authentication flow including token caching in Redis.