Skip to main content

Provides a simple and robust interaction with the Veridas API.

Project description

Welcome

License: MIT Documentation CI codecov PyPI version Maintenance

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

vericlient-0.1.1.tar.gz (18.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

vericlient-0.1.1-py3-none-any.whl (14.8 kB view details)

Uploaded Python 3

File details

Details for the file vericlient-0.1.1.tar.gz.

File metadata

  • Download URL: vericlient-0.1.1.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

Hashes for vericlient-0.1.1.tar.gz
Algorithm Hash digest
SHA256 1a965b143556f45f86147b8aed129d02777d8ffecc8d1c8b33c34648f87e7dc8
MD5 e33d799ae226791a5b935f389971885f
BLAKE2b-256 57360334b29275c063901374ce3e90cff765e19efcafd84ffbf2393a717c1da2

See more details on using hashes here.

File details

Details for the file vericlient-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: vericlient-0.1.1-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

Hashes for vericlient-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 1bf767fd09374f1e1c460b4c81c9898aec90922771add4118fa0a5fb8cd063bf
MD5 61c1b96f3c27e5c0aaaaff733ba1ea4a
BLAKE2b-256 db99138d14d1ca78a5283a37615477021f46bc98e21b94bc493fea292d26613f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page