Rapidata client
RapidataClient #
RapidataClient(
client_id: str | None = None,
client_secret: str | None = None,
environment: str | None = None,
oauth_scope: str = "openid roles email",
cert_path: str | None = None,
token: dict | None = None,
leeway: int = 60,
)
The Rapidata client is the main entry point for interacting with the Rapidata API. It allows you to create orders and validation sets.
Credentials are resolved in the following order:
client_id/client_secretpassed explicitly to this constructor.- The
RAPIDATA_CLIENT_ID/RAPIDATA_CLIENT_SECRETenvironment variables (useful for headless / container deployments). - Credentials stored under
~/.config/rapidata/credentials.json. - Interactive browser login, which then saves credentials to the file above so you don't have to log in again.
The environment argument follows the same pattern: when omitted
it falls back to the RAPIDATA_ENVIRONMENT environment variable,
and finally to the default "rapidata.ai".
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
client_id
|
str
|
The client ID for authentication. Falls back to
the |
None
|
client_secret
|
str
|
The client secret for authentication. Falls
back to the |
None
|
environment
|
str
|
The API endpoint. Falls back to the
|
None
|
oauth_scope
|
str
|
The scopes to use for authentication. In general this does not need to be changed. |
'openid roles email'
|
cert_path
|
str
|
An optional path to a certificate file useful for development. |
None
|
token
|
dict
|
If you already have a token that the client should use for authentication. Important, if set, this needs to be the complete token object containing the access token, token type and expiration time. |
None
|
leeway
|
int
|
An optional leeway to use to determine if a token is expired. Defaults to 60 seconds. |
60
|
Attributes:
| Name | Type | Description |
|---|---|---|
order |
RapidataOrderManager
|
The RapidataOrderManager instance. |
validation |
ValidationSetManager
|
The ValidationSetManager instance. |
flow |
RapidataFlowManager
|
The RapidataFlowManager instance. |
audience |
RapidataAudienceManager
|
The RapidataAudienceManager instance. |
job |
JobManager
|
The JobManager instance. |
mri |
RapidataBenchmarkManager
|
The RapidataBenchmarkManager instance. |
Source code in src/rapidata/rapidata_client/rapidata_client.py
43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 | |
reset_credentials #
Reset the credentials saved in the configuration file for the current environment.