Skip to main content

Python SDK for the Lorica biometric verification API

Project description

lorica

Python SDK for the Lorica biometric verification API.

Prove a human did it. One API call before any high-risk action. 16 security layers. Under 2 seconds. $0.05.

Install

pip install lorica

Quick Start

from lorica import LoricaClient

client = LoricaClient("lrca_live_...")

# Enroll a user (once)
client.enroll(user_id="usr_123", image=face_base64)

# Verify before any high-risk action
result = client.verify(
    user_id="usr_123",
    image=face_base64,
    action_context="wire_transfer_50k",
    liveness_mode="passive"  # or "dual_frame" or "motion"
)

if result["match"]:
    jwt = result["token"]  # signed proof of authorization
    process_transfer(jwt)
else:
    block_action(result["rejection_reason"])

Read Image from File

image_b64 = LoricaClient.image_from_file("photo.jpg")
client.verify(user_id="usr_123", image=image_b64, action_context="trade")

Multi-Party Verification

result = client.verify_multi(
    verifications=[
        {"user_id": "trader_001", "image": trader_face, "role": "trader"},
        {"user_id": "risk_mgr", "image": manager_face, "role": "risk_manager"},
    ],
    action_context="otc_block_trade",
    require_all=True
)
# result["all_verified"] == True, result["token"] = single JWT

Pre-Action Identity Lock

lock = client.create_lock(
    user_id="usr_123",
    image=face_base64,
    action_context="multi_venue_execution",
    duration_seconds=120
)
# lock["session_id"], lock["expires_at"]

client.lock_heartbeat(lock["session_id"])  # extend
client.lock_revoke(lock["session_id"])     # revoke

Analytics

client.stats(period="30d")
client.user_report(user_id="usr_123")
client.billing_usage()
client.thresholds()  # AI-recommended thresholds

Error Handling

from lorica import LoricaClient
from lorica.client import LoricaError

try:
    result = client.verify(user_id="usr_123", image=face)
except LoricaError as e:
    print(e.status_code)  # 404
    print(e.error_code)   # "user_not_enrolled"
    print(e.message)      # "No enrollment found..."

Links

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

lorica_sdk-0.1.0.tar.gz (6.4 kB view details)

Uploaded Source

Built Distribution

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

lorica_sdk-0.1.0-py3-none-any.whl (6.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: lorica_sdk-0.1.0.tar.gz
  • Upload date:
  • Size: 6.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for lorica_sdk-0.1.0.tar.gz
Algorithm Hash digest
SHA256 e1887623d5f3da93ed04c149421a241d01464eed9ce4d9841da5c75d62f68d1d
MD5 c6c43e2ce20e4444e77b024b945f8dbb
BLAKE2b-256 fc45bd54dfa0d8b057632ae82e080014b4e3c9cf43d3fc1fb78df49b36d56691

See more details on using hashes here.

File details

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

File metadata

  • Download URL: lorica_sdk-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 6.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for lorica_sdk-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 004155a6b9ace5398251e2a51b80cb61cb1e2c9f2d4c0f917364524e3782c654
MD5 e7fd8f8247314417438902c728e37cfa
BLAKE2b-256 55ed4b28a56b5548447584f3efd78fd4ac62e98879d17751527b164158cbe5b5

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