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.0.tar.gz (8.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.0-py3-none-any.whl (8.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: facevault-0.1.0.tar.gz
  • Upload date:
  • Size: 8.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: Hatch/1.16.3 cpython/3.11.14 HTTPX/0.28.1

File hashes

Hashes for facevault-0.1.0.tar.gz
Algorithm Hash digest
SHA256 c580b47b1daab4b354a6ff0ed3e32f09625db9723cfcd9a0ddb04fe7a0004f2d
MD5 6c6df463836aa3777c0a5ea8ced1320b
BLAKE2b-256 245a1982155a7a5c0b299cf958b19346e49755790369fd68af44bd3848b4776f

See more details on using hashes here.

File details

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

File metadata

  • Download URL: facevault-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 8.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: Hatch/1.16.3 cpython/3.11.14 HTTPX/0.28.1

File hashes

Hashes for facevault-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 87b13a9a10f0798cc4ec36ddfea6f2da428d2afdd37e7919ff703b7826013a1e
MD5 e2b110bcb4b50f69933764a5878a9fae
BLAKE2b-256 836b90fefe4341bebe4603412ff6c35172c4aba7e6485fb805e3c2d9d581c43c

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