Provides a simple and robust interaction with the Veridas API.
Project description
Welcome
Vericlient is a Python library designed to facilitate interaction with the Veridas API. It provides a simple and robust interface for making API requests and handling responses efficiently.
Features
- Easy to Use: Designed to be intuitive and easy to integrate into your projects.
- Exception Handling: Includes error and exception handling for safer interaction with the API.
- Modular and Extensible: Structured to easily add new functionalities and endpoints.
- Minimal Dependencies to work.
Current APIs support
- 🟢: fully supported.
- 🟠: partly supported.
- 🔴: not yet supported.
| API | Status | Docs Link |
|---|---|---|
| das-Peak | 🟢 | https://clarriu97.github.io/vericlient/api_docs/daspeak/client/ |
| VCSP | 🔴 | None |
| das-Face | 🔴 | None |
Installation
To install the library, you can use pip:
pip install vericlient
Basic Usage
from vericlient import DaspeakClient
from vericlient.daspeak.models import (
GenerateCredentialInput,
CompareCredential2AudioInput,
)
client = DaspeakClient(apikey="your_api_key")
# check if the server is alive
print(f"Alive: {client.alive()}")
# generate a credential from a BytesIO object using the last model
with open("/home/audio.wav", "rb") as f:
model_input = GenerateCredentialInput(
audio=f.read(),
hash=client.get_models().models[-1],
)
generate_credential_output = client.generate_credential(model_input)
print(f"Credential generated with virtual file: {generate_credential_output.credential}")
# compare a credential with an audio file
compare_input = CompareCredential2AudioInput(
audio_to_evaluate="/home/audio.wav",
credential_reference=generate_credential_output.credential,
)
compare_output = client.compare(compare_input)
print(f"Similarity between the credential and the audio file: {compare_output.score}")
# compare a credential with a BytesIO object
with open("/home/audio.wav", "rb") as f:
compare_input = CompareCredential2AudioInput(
audio_to_evaluate=f.read(),
credential_reference=generate_credential_output.credential,
)
compare_output = client.compare(compare_input)
print(f"Similarity between the credential and the virtual file: {compare_output.score}")
You can also use the client against any self-hosted Veridas API:
from vericlient import DaspeakClient
# Create a client for the das-Peak API
client = DaspeakClient(url="https://your-self-hosted-api.com")
# Test the connection
print(client.alive())
Configuration
The library can be configured using environment variables. The following variables are supported:
VERICLIENT_ENVIRONMENT: The environment to use for the requests (default:sandbox).VERICLIENT_APIKEY: The API key to use for the requests against the Veridas Cloud API.VERICLIENT_LOCATION: The location to use for the requests (default:eu).VERICLIENT_URL: In case you want to use a self-hosted API, you can set the URL with this variable.VERICLIENT_TIMEOUT: The timeout for the requests (default:10).
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file vericlient-0.1.2.tar.gz.
File metadata
- Download URL: vericlient-0.1.2.tar.gz
- Upload date:
- Size: 18.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.10.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b39feb9d5d4f258369f4050eecbf7b35483d651bc418d53a6aac87f4de480355
|
|
| MD5 |
ccc66bc1bfd4cf727f6937a2865d0a60
|
|
| BLAKE2b-256 |
f7e5ed6c7ecdbddfa15664ee03b8eee436b13f324066138689c40d99b81cf6aa
|
File details
Details for the file vericlient-0.1.2-py3-none-any.whl.
File metadata
- Download URL: vericlient-0.1.2-py3-none-any.whl
- Upload date:
- Size: 14.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.10.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a309c77aca17068c3c28146838953308ba9e56b02824a8d5b1a86d1823070b76
|
|
| MD5 |
cb2bce27e1d5179ca6525f0f3e8d20d5
|
|
| BLAKE2b-256 |
3749c32e4ee9302bf6c5313f58464c2d5a8a097449ca676d99907f1878eeb1db
|