Skip to main content

AuraGyt Python SDK

Python SDK for AuraGyt biometric authentication and identity verification API.

Installation

pip install auragyt-sdk

Or install from source:

git clone https://github.com/auragyt/auragyt-app.git
cd auragyt-app/sdk/python
pip install -e .

Quick Start

from auragyt_sdk import AuraGytSDK

# Initialize SDK
sdk = AuraGytSDK({
    "base_url": "http://localhost:8000",
    "api_key": "your-api-key"  # Optional
})

# Register a new user
user = sdk.auth.register("user@example.com", "password123")

# Login
tokens = sdk.auth.login("user@example.com", "password123")

# Enroll face
enrollment_result = sdk.auth.enroll_face("path/to/face_image.jpg")

# Verify face
verification_result = sdk.auth.verify_face("path/to/face_image.jpg")
print(f"Match: {verification_result.is_match}, Score: {verification_result.similarity_score}")

# Detect faces
faces = sdk.face.detect("path/to/image.jpg")
for face in faces:
    print(f"Confidence: {face.confidence}, BBox: {face.bbox}")

# Check liveness
liveness_result = sdk.liveness.check(["frame1.jpg", "frame2.jpg", "frame3.jpg"])
print(f"Live: {liveness_result.is_live}, Score: {liveness_result.liveness_score}")

# Calculate risk score
risk_result = sdk.risk.calculate_risk_score(
    device_fingerprint="device123",
    ip_address="192.168.1.1"
)
print(f"Risk Score: {risk_result.risk_score}, Level: {risk_result.risk_level}")

Configuration

from auragyt_sdk import AuraGytSDK

sdk = AuraGytSDK({
    "api_key": "your-api-key",        # API key for authentication
    "base_url": "https://api.auragyt.com",  # API base URL
    "timeout": 30,                     # Request timeout in seconds
    "retries": 3,                      # Number of retries
    "retry_delay": 1,                  # Delay between retries in seconds
    "access_token": "token"            # Access token (set automatically after login)
})

Features

Face Recognition

  • Face Detection: Detect faces in images
  • Face Embedding: Extract face embeddings for comparison
  • Face Verification: Verify if two faces match (1:1)
  • Face Search: Search for similar faces in database (1:N)
# Detect faces
faces = sdk.face.detect("image.jpg")

# Extract embedding
embedding = sdk.face.embed("image.jpg")

# Verify two faces
result = sdk.face.verify("image1.jpg", "image2.jpg", threshold=0.6)

# Search for similar faces
search_result = sdk.face.search("image.jpg", top_k=5, threshold=0.6)

Liveness Detection

  • Liveness Check: Check if face is live from video frames
  • Spoofing Detection: Detect spoofing attempts
# Check liveness from video frames
result = sdk.liveness.check(["frame1.jpg", "frame2.jpg"], challenge_type="blink")

# Detect spoofing
spoof_result = sdk.liveness.detect_spoofing("image.jpg")

Authentication

  • User Registration: Register new users
  • Login/Logout: Authenticate users
  • Token Management: Handle access and refresh tokens
  • Face Enrollment: Enroll face templates for users
  • Face Verification: Verify faces against enrolled templates
# Register
user = sdk.auth.register("user@example.com", "password")

# Login
tokens = sdk.auth.login("user@example.com", "password")

# Enroll face
enrollment = sdk.auth.enroll_face("face.jpg", quality_threshold=0.7)

# Verify face
verification = sdk.auth.verify_face("face.jpg", threshold=0.6)

# Get current user
user = sdk.auth.get_current_user()

# Refresh token
tokens = sdk.auth.refresh_token()

# Logout
sdk.auth.logout()

Risk Management

  • Risk Scoring: Calculate risk scores for transactions
  • Blacklist Checking: Check if users/devices/IPs are blacklisted
# Calculate risk score
risk = sdk.risk.calculate_risk_score(
    user_id="user123",
    device_fingerprint="device123",
    ip_address="192.168.1.1"
)

# Check blacklist
blacklist = sdk.risk.check_blacklist(
    user_id="user123",
    device_fingerprint="device123",
    ip_address="192.168.1.1"
)

Error Handling

The SDK provides custom exceptions for different error types:

from auragyt_sdk import (
    AuraGytError,
    NetworkError,
    AuthenticationError,
    ValidationError,
    ServiceUnavailableError
)

try:
    result = sdk.face.detect("image.jpg")
except AuthenticationError as e:
    print(f"Authentication failed: {e}")
except ValidationError as e:
    print(f"Validation error: {e}")
except NetworkError as e:
    print(f"Network error: {e}")
except AuraGytError as e:
    print(f"API error: {e}")

Type Hints

The SDK is fully typed with type hints for better IDE support:

from auragyt_sdk import (
    FaceDetectionResult,
    FaceVerificationResult,
    LivenessCheckResult,
    EnrollmentResult,
    User,
    AuthTokens
)

faces: list[FaceDetectionResult] = sdk.face.detect("image.jpg")
result: FaceVerificationResult = sdk.face.verify("img1.jpg", "img2.jpg")

Examples

See the examples/ directory for more detailed examples.

API Reference

Full API reference documentation is available at https://github.com/auragyt/auragyt-app.

License

MIT License

Support

For issues and questions, please visit https://github.com/auragyt/auragyt-app/issues.

Metadata

Release files for auragyt-sdk 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for auragyt-sdk 1.0.0
File Size Uploaded Provenance
auragyt_sdk-1.0.0.tar.gz 14.4 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for auragyt-sdk 1.0.0
File Interpreter ABI Platform
auragyt_sdk-1.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 29.4 kB

Release files / auragyt_sdk-1.0.0.tar.gz

Download URL auragyt_sdk-1.0.0.tar.gz
Size 14.4 kB
Tags Source
SHA-256 checksum
How to use checksums
fda5da2dd25c704113622ba20557aa76b6cac4ea6d306ad6692b7886d965190d
BLAKE2b-256 checksum
How to use checksums
ccaab7be4c9d3991a77a17eab0403bd042a91959afd30294ed8e47610b0fde33
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.6

Release files / auragyt_sdk-1.0.0-py3-none-any.whl

Download URL auragyt_sdk-1.0.0-py3-none-any.whl
Size 15.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
daf2266b06ee33e64b01709303bdbf58eb3c6cbbd752bee8ba00e575b1e7a3bb
BLAKE2b-256 checksum
How to use checksums
7971771080dd7bd4fdceee6a16f8501a40806da6a2cfeafd67d52aee55755a08
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.6

Security for auragyt-sdk 1.0.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page