VCSP client docs
vericlient.vcsp.client.VcspClient
¶
Bases: Client
Class to interact with the VCSP API.
Source code in src/vericlient/vcsp/client.py
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 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 |
|
__init__(api=APIs.VCSP.value, apikey=None, timeout=None, environment=None, location=None, url=None, headers=None)
¶
Create the VcspClient class.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
api |
str
|
The API to use |
VCSP.value
|
apikey |
str | None
|
The API key to use |
None
|
timeout |
int | None
|
The timeout to use in the requests |
None
|
environment |
str | None
|
The environment to use |
None
|
location |
str | None
|
The location to use |
None
|
url |
str | None
|
The URL to use in case of a custom target |
None
|
headers |
dict | None
|
The headers to be used in the requests |
None
|
Source code in src/vericlient/vcsp/client.py
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 |
|
alive()
¶
Check if the service is alive.
Returns bool: True if the service is alive, False otherwise
Source code in src/vericlient/vcsp/client.py
110 111 112 113 114 115 116 117 118 119 |
|
delete_account(data_model)
¶
Delete an account.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
data_model |
DeleteAccountInput
|
The input to delete the account |
required |
Raises:
Type | Description |
---|---|
AccountNotFoundError
|
If the account is not found |
Source code in src/vericlient/vcsp/client.py
245 246 247 248 249 250 251 252 253 254 255 256 |
|
delete_credential(data_model)
¶
Delete a credential.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
data_model |
DeleteCredentialInput
|
The input to delete the credential |
required |
Source code in src/vericlient/vcsp/client.py
294 295 296 297 298 299 300 301 302 303 |
|
enroll_subject(data_model)
¶
Enroll a subject.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
data_model |
EnrollmentInput
|
The input to enroll the subject |
required |
Returns:
Name | Type | Description |
---|---|---|
EnrollmentOutput |
EnrollmentOutput
|
The output of the enrollment |
Raises:
Type | Description |
---|---|
EmptyFileError
|
If the file is empty |
InvalidClaimsError
|
If the claims are invalid |
InvalidAssuranceError
|
If the assurance is invalid |
InvalidTagsError
|
If the tags are invalid |
InvalidCredentialConfigurationUrnError
|
If the credential configuration urn is invalid |
InvalidAssuranceMethodUrnError
|
If the assurance method urn is invalid |
CredentialConfigurationUrnAlreadyAssignedError
|
If the credential configuration urn is already assigned |
InvalidAudioFormatError
|
If the audio format is invalid |
InvalidSnrError
|
If the signal noise ratio is invalid |
VoiceDurationIsNotEnoughError
|
If the voice duration is not enough |
InsufficientQualityError
|
If the quality is insufficient |
FaceAlignmentError
|
If the face is not aligned |
FaceNotFoundError
|
If the face is not found |
FaceTooSmallError
|
If the face is too small |
MoreThanOneFaceError
|
If there is more than one face |
AssuranceValidationError
|
If the assurance is invalid |
RequestValidationError
|
If the request is invalid |
UnsupportedMediaTypeError
|
If the media type is not supported |
Source code in src/vericlient/vcsp/client.py
174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 |
|
get_account(data_model)
¶
Get an account.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
data_model |
GetAccountInput
|
The input to get the account |
required |
Returns:
Name | Type | Description |
---|---|---|
GetAccountOutput |
GetAccountOutput
|
The output of the account |
Raises:
Type | Description |
---|---|
AccountNotFoundError
|
If the account is not found |
Source code in src/vericlient/vcsp/client.py
228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 |
|
get_all_subject_credentials(data_model)
¶
Get all credentials for a subject.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
data_model |
GetCredentialsInput
|
The input to get all credentials for the subject |
required |
Returns:
Name | Type | Description |
---|---|---|
GetCredentialsOutput |
GetCredentialsOutput
|
The output of the credentials |
Raises:
Type | Description |
---|---|
AccountNotFoundError
|
If the account is not found |
Source code in src/vericlient/vcsp/client.py
258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 |
|
get_assurance_method_info(data_model)
¶
Get an assurance method.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
data_model |
AssuranceMethodInput
|
The input to get the assurance method |
required |
Returns:
Name | Type | Description |
---|---|---|
AssuranceMethodOutput |
AssuranceMethodOutput
|
The output of the assurance method |
Source code in src/vericlient/vcsp/client.py
160 161 162 163 164 165 166 167 168 169 170 171 172 |
|
get_assurance_methods()
¶
Get all assurance methods.
Returns:
Name | Type | Description |
---|---|---|
AssuranceMethodsOutput |
AssuranceMethodsOutput
|
The output of the assurance methods |
Source code in src/vericlient/vcsp/client.py
146 147 148 149 150 151 152 153 154 155 156 157 158 |
|
get_credential(data_model)
¶
Get a credential.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
data_model |
GetCredentialInput
|
The input to get the credential |
required |
Returns:
Name | Type | Description |
---|---|---|
GetCredentialOutput |
GetCredentialOutput
|
The output of the credential |
Raises:
Type | Description |
---|---|
CredentialNotFoundError
|
If the credential is not found |
AccountNotFoundError
|
If the account is not found |
Source code in src/vericlient/vcsp/client.py
275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 |
|
get_credential_configurations()
¶
Get all credential configurations.
Returns:
Name | Type | Description |
---|---|---|
CredentialConfigurationsOutput |
CredentialConfigurationsOutput
|
The output of the credential configurations |
Source code in src/vericlient/vcsp/client.py
132 133 134 135 136 137 138 139 140 141 142 143 144 |
|
vericlient.vcsp.models
¶
Module to define the models for the VCSP API.
Applicant
¶
Bases: BaseModel
Base class for the Applicant.
Attributes:
Name | Type | Description |
---|---|---|
subject_id |
str | None
|
The subject_id of the applicant (optional). If not provided, it will be generated by the system and returned in the response |
credential_configuration_urn |
str
|
The credential configuration urn |
tags |
list[str] | None
|
The tags of the applicant |
claims |
dict | None
|
The claims of the applicant |
assurance_method_urn |
str
|
The assurance method urn |
assurance |
dict
|
The assurance of the applicant |
Source code in src/vericlient/vcsp/models.py
103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 |
|
AssuranceMethodInput
¶
Bases: BaseModel
Input class for the assurance method endpoint.
Attributes:
Name | Type | Description |
---|---|---|
urn |
str
|
The urn of the assurance method |
Source code in src/vericlient/vcsp/models.py
60 61 62 63 64 65 66 67 68 |
|
AssuranceMethodOutput
¶
Bases: VcspResponse
Output class for the assurance method endpoint.
Attributes:
Name | Type | Description |
---|---|---|
urn |
str
|
The urn of the assurance method |
schema |
AssuranceMethodSchema
|
The schema of the assurance method |
Source code in src/vericlient/vcsp/models.py
71 72 73 74 75 76 77 78 79 80 81 |
|
AssuranceMethodSchema
¶
Bases: BaseModel
Schema class for the assurance method.
Attributes:
Name | Type | Description |
---|---|---|
$schema |
The schema of the assurance method |
|
title |
str
|
The title of the assurance method |
type |
str
|
The type of the assurance method |
properties |
dict
|
The properties of the assurance method |
required |
list[str] | None
|
The required properties of the assurance method |
additionalProperties |
bool
|
Whether additional properties are allowed |
Source code in src/vericlient/vcsp/models.py
39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 |
|
AssuranceMethodsOutput
¶
Bases: VcspResponse
Output class for the assurance methods endpoint.
Attributes:
Name | Type | Description |
---|---|---|
assurance_methods |
list[str]
|
The assurance methods |
Source code in src/vericlient/vcsp/models.py
28 29 30 31 32 33 34 35 36 |
|
CredentialConfigurationsOutput
¶
Bases: VcspResponse
Output class for the credential configurations endpoint.
Attributes:
Name | Type | Description |
---|---|---|
credential_configurations |
list[str]
|
The credential configurations |
Source code in src/vericlient/vcsp/models.py
17 18 19 20 21 22 23 24 25 |
|
CredentialInput
¶
Bases: BaseModel
Input class to define a credential.
Attributes:
Name | Type | Description |
---|---|---|
credential_id |
str
|
The credential_id of the applicant |
Source code in src/vericlient/vcsp/models.py
174 175 176 177 178 179 180 181 182 |
|
DeleteAccountInput
¶
Bases: SubjectInput
Input class for the delete account endpoint.
Attributes:
Name | Type | Description |
---|---|---|
subject_id |
The account_id to delete |
Source code in src/vericlient/vcsp/models.py
271 272 273 274 275 276 277 |
|
DeleteCredentialInput
¶
Bases: SubjectInput
, CredentialInput
Input class for the delete credential endpoint.
Attributes:
Name | Type | Description |
---|---|---|
credential_id |
The credential_id to delete |
|
subject_id |
The subject from which the credential will be deleted |
Source code in src/vericlient/vcsp/models.py
194 195 196 197 198 199 200 201 |
|
DeleteSubjectInput
¶
Bases: SubjectInput
Input class for the delete account endpoint.
Attributes:
Name | Type | Description |
---|---|---|
subject_id |
The account_id to delete |
Source code in src/vericlient/vcsp/models.py
185 186 187 188 189 190 191 |
|
EnrollmentInput
¶
Bases: BaseModel
Input class for the enrollment endpoint.
Attributes:
Name | Type | Description |
---|---|---|
sample |
str | bytes
|
The sample to generate the credential with. It can be a path to a file or a bytes object with the audio content |
applicant |
Applicant
|
The applicant to enroll |
Source code in src/vericlient/vcsp/models.py
125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 |
|
EnrollmentOutput
¶
Bases: BaseModel
Output class for the enrollment endpoint.
Attributes:
Name | Type | Description |
---|---|---|
credential_id |
str
|
The credential_id of the applicant |
subject_id |
str
|
The subject_id of the applicant |
Source code in src/vericlient/vcsp/models.py
150 151 152 153 154 155 156 157 158 159 160 |
|
GetAccountInput
¶
Bases: SubjectInput
Input class for the get account endpoint.
Attributes:
Name | Type | Description |
---|---|---|
subject_id |
The account_id to get |
Source code in src/vericlient/vcsp/models.py
204 205 206 207 208 209 210 |
|
GetAccountOutput
¶
Bases: VcspResponse
Output class for the get account endpoint.
Attributes:
Name | Type | Description |
---|---|---|
credentials |
list[str]
|
The credentials of the applicant |
updated_at |
str
|
The updated_at date |
created_at |
str
|
The created_at date |
subject_id |
str
|
The subject_id of the applicant |
Source code in src/vericlient/vcsp/models.py
254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 |
|
GetCredentialInput
¶
Bases: SubjectInput
, CredentialInput
Input class for the get a specific credential endpoint.
Attributes:
Name | Type | Description |
---|---|---|
subject_id |
The subject_id to get the credential from |
|
credential_id |
The credential_id to get |
Source code in src/vericlient/vcsp/models.py
213 214 215 216 217 218 219 220 |
|
GetCredentialOutput
¶
Bases: BaseModel
Output class for the get credential endpoint.
Attributes:
Name | Type | Description |
---|---|---|
sample |
Sample
|
The sample of the applicant |
groups |
list[str]
|
The groups of the applicant |
issuer |
str
|
The issuer |
id |
str
|
The id of the applicant |
updated_at |
str
|
The updated_at date |
created_at |
str
|
The created_at date |
valid_from |
str
|
The valid_from date |
valid_until |
str
|
The valid_until date |
credential_configuration_urn |
str
|
The credential_configuration_urn |
tags |
list[str]
|
The tags of the applicant |
claims |
dict
|
The claims of the applicant |
Source code in src/vericlient/vcsp/models.py
223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 |
|
GetCredentialsInput
¶
Bases: SubjectInput
Input class for the get all credentials from a subject endpoint.
Attributes:
Name | Type | Description |
---|---|---|
subject_id |
The account_id to get the credentials from |
Source code in src/vericlient/vcsp/models.py
280 281 282 283 284 285 286 |
|
GetCredentialsOutput
¶
Bases: VcspResponse
Output class for the get all credentials from a subject endpoint.
Attributes:
Name | Type | Description |
---|---|---|
credentials |
list[GetCredentialOutput]
|
The credentials of the applicant |
Source code in src/vericlient/vcsp/models.py
289 290 291 292 293 294 295 296 297 |
|
Sample
¶
Bases: BaseModel
Base class for the Sample.
Attributes:
Name | Type | Description |
---|---|---|
valid_from |
str
|
The date from which the sample is valid |
valid_until |
str
|
The date until which the sample is valid |
type |
str
|
The type of the sample, e.g. "voice", "face" |
content_type |
str
|
The content type of the sample, e.g. "audio/wav", "image/jpeg" |
analysis |
dict
|
The analysis of the sample |
Source code in src/vericlient/vcsp/models.py
84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 |
|
SubjectInput
¶
Bases: BaseModel
Input class to define a subject.
Attributes:
Name | Type | Description |
---|---|---|
subject_id |
str
|
The subject_id of the applicant |
Source code in src/vericlient/vcsp/models.py
163 164 165 166 167 168 169 170 171 |
|
VcspResponse
¶
Bases: BaseModel
Base class for the VCSP API responses.
Attributes:
Name | Type | Description |
---|---|---|
status_code |
int
|
The status code of the response |
Source code in src/vericlient/vcsp/models.py
6 7 8 9 10 11 12 13 14 |
|
vericlient.vcsp.exceptions
¶
Module to define the exceptions for the VCSP API.
AccountNotFoundError
¶
Bases: VcspError
Exception raised for account not found.
Source code in src/vericlient/vcsp/exceptions.py
164 165 166 167 168 169 |
|
AssuranceMethodNotFoundError
¶
Bases: VcspError
Exception raised for assurance method not found.
Source code in src/vericlient/vcsp/exceptions.py
148 149 150 151 152 153 |
|
AssuranceValidationError
¶
Bases: VcspError
Exception raised for assurance validation error.
Source code in src/vericlient/vcsp/exceptions.py
156 157 158 159 160 161 |
|
CredentialConfigurationUrnAlreadyAssignedError
¶
Bases: VcspError
Exception raised for already assigned credential configuration urn.
Source code in src/vericlient/vcsp/exceptions.py
76 77 78 79 80 81 |
|
CredentialNotFoundError
¶
Bases: VcspError
Exception raised for credential not found.
Source code in src/vericlient/vcsp/exceptions.py
172 173 174 175 176 177 |
|
EmptyFileError
¶
Bases: VcspError
Exception raised for empty files.
Source code in src/vericlient/vcsp/exceptions.py
12 13 14 15 16 17 |
|
FaceAlignmentError
¶
Bases: VcspError
Exception raised for face alignment error.
Source code in src/vericlient/vcsp/exceptions.py
140 141 142 143 144 145 |
|
FaceNotFoundError
¶
Bases: VcspError
Exception raised for face not found.
Source code in src/vericlient/vcsp/exceptions.py
116 117 118 119 120 121 |
|
FaceTooSmallError
¶
Bases: VcspError
Exception raised for face too small.
Source code in src/vericlient/vcsp/exceptions.py
132 133 134 135 136 137 |
|
InsufficientQualityError
¶
Bases: VcspError
Exception raised for insufficient quality.
Source code in src/vericlient/vcsp/exceptions.py
108 109 110 111 112 113 |
|
InvalidAssuranceError
¶
Bases: VcspError
Exception raised for invalid assurance.
Source code in src/vericlient/vcsp/exceptions.py
44 45 46 47 48 49 |
|
InvalidAssuranceMethodUrnError
¶
Bases: VcspError
Exception raised for invalid assurance method.
Source code in src/vericlient/vcsp/exceptions.py
68 69 70 71 72 73 |
|
InvalidAudioFormatError
¶
Bases: VcspError
Exception raised for invalid audio format.
Source code in src/vericlient/vcsp/exceptions.py
84 85 86 87 88 89 |
|
InvalidClaimsError
¶
Bases: VcspError
Exception raised for invalid claims.
Source code in src/vericlient/vcsp/exceptions.py
36 37 38 39 40 41 |
|
InvalidCredentialConfigurationUrnError
¶
Bases: VcspError
Exception raised for invalid credential configuration urn.
Source code in src/vericlient/vcsp/exceptions.py
60 61 62 63 64 65 |
|
InvalidSnrError
¶
Bases: VcspError
Exception raised for invalid signal noise ratio.
Source code in src/vericlient/vcsp/exceptions.py
92 93 94 95 96 97 |
|
InvalidTagsError
¶
Bases: VcspError
Exception raised for invalid tags.
Source code in src/vericlient/vcsp/exceptions.py
52 53 54 55 56 57 |
|
MoreThanOneFaceError
¶
Bases: VcspError
Exception raised for more than one face.
Source code in src/vericlient/vcsp/exceptions.py
124 125 126 127 128 129 |
|
RequestValidationError
¶
Bases: VcspError
Exception raised for request validation error.
Source code in src/vericlient/vcsp/exceptions.py
20 21 22 23 24 25 |
|
UnsupportedMediaTypeError
¶
Bases: VcspError
Exception raised for unsupported media type.
Source code in src/vericlient/vcsp/exceptions.py
28 29 30 31 32 33 |
|
VcspError
¶
Bases: VeriClientError
Base class for exceptions in the VCSP API.
Source code in src/vericlient/vcsp/exceptions.py
5 6 7 8 9 |
|
VoiceDurationIsNotEnoughError
¶
Bases: VcspError
Exception raised for voice duration not enough.
Source code in src/vericlient/vcsp/exceptions.py
100 101 102 103 104 105 |
|