Skip to main content

Python SDK for the FaceVault identity verification API

Project description

FaceVault Python SDK

Python client for the FaceVault identity verification API. Supports sync and async usage, webhook verification, and typed models.

Installation

pip install facevault

Quick start

Sync

from facevault import FaceVaultClient

client = FaceVaultClient("fv_live_your_api_key")

# Create a verification session
session = client.create_session(external_user_id="user-123")
print(session.webapp_url)  # Send this URL to your user

# Check session status
status = client.get_session(session.session_id)
print(status.status)  # "pending", "completed", "failed"

client.close()

Async

from facevault import AsyncFaceVaultClient

async def verify_user():
    async with AsyncFaceVaultClient("fv_live_your_api_key") as client:
        session = await client.create_session(external_user_id="user-123")
        print(session.webapp_url)

Webhook verification

from facevault import verify_signature, parse_event

# Verify the webhook signature
body = request.body
signature = request.headers["X-Signature"]

if verify_signature(body, signature, secret="your_webhook_secret"):
    event = parse_event(body)
    print(event.event)            # "session.completed"
    print(event.session_id)
    print(event.face_match_passed)

Error handling

from facevault import FaceVaultClient, AuthError, NotFoundError, RateLimitError

client = FaceVaultClient("fv_live_your_api_key")

try:
    session = client.get_session("nonexistent")
except AuthError:
    print("Invalid API key")
except NotFoundError:
    print("Session not found")
except RateLimitError:
    print("Too many requests")

Documentation

Full API docs at facevault.id/docs.

License

MIT

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

facevault-0.1.1.tar.gz (7.5 kB view details)

Uploaded Source

Built Distribution

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

facevault-0.1.1-py3-none-any.whl (8.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: facevault-0.1.1.tar.gz
  • Upload date:
  • Size: 7.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.14

File hashes

Hashes for facevault-0.1.1.tar.gz
Algorithm Hash digest
SHA256 31d00edfdf578e2ce18c990f9e796ef15cb85d7a1c0d0ffad207efdbedb39c88
MD5 38546624e3513d4eaafc64a9e2535cd3
BLAKE2b-256 92d90612d54d9a508880673ddb9a5c179da2effd4822fcfca8a51dacbe4781ab

See more details on using hashes here.

File details

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

File metadata

  • Download URL: facevault-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 8.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.14

File hashes

Hashes for facevault-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 cf35124f693ad666c88c0235a823cd71e7389dc3174ef6eb6356095d718e97ed
MD5 a1b1631929f235149a397a0001f87e36
BLAKE2b-256 7446a11c99cb8a1e6887aed42e7ab20b424863754332ed935879b126d152d1ad

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