Python SDK for the Reeve API - A facial recognition service for person identification and verification
Project description
reeve_python_sdk
Python SDK for the Reeve API - A facial recognition service for person identification and verification.
This SDK provides a Python interface to interact with the Reeve API, enabling facial recognition capabilities including person management, face enrollment, face recognition, and face verification.
Features
Authentication - Username/password login, user registration, password management, and Bearer JWT support
Person Management - Create, list, update, and delete persons
Face Management - Add, list, and delete face images for persons
Face Recognition - Identify unknown faces with confidence scores and face attributes
Face Verification - Verify faces against specific persons or compare two faces
Rich Data Models - Strongly-typed models for all API responses including face attributes
Installation
pip install reeve_python_sdk
Development Installation
git clone https://github.com/qbit-codes/reeve-python-sdk.git
cd reeve-python-sdk
pip install -e .
Quick Start
Authentication Methods
The SDK supports two authentication methods:
Method 1: Username/Password (Recommended)
import asyncio
from reeve_python_sdk import ReeveClient
async def main():
# Auto-login with username and password
async with ReeveClient(
api_url="https://api.reeve.example.com",
username="your-username",
password="your-password"
) as client:
# Create a person
person = await client.person.add(firstname="John", lastname="Doe")
person_id = person["result"]["id"]
# Add a face to the person
with open("face.jpg", "rb") as f:
await client.face.add(person_id=person_id, face=f)
# Recognize a face
with open("unknown_face.jpg", "rb") as f:
result = await client.face.recognize(face=f)
if result.get("result"):
print(f"Recognized: {result['result']['name']}")
asyncio.run(main())
Method 2: Direct API Key
import asyncio
from reeve_python_sdk import ReeveClient
async def main():
# Use existing JWT token
async with ReeveClient(
api_url="https://api.reeve.example.com",
api_key="your-jwt-token"
) as client:
persons = await client.person.list()
print(persons)
asyncio.run(main())
Advanced Usage
Manual Login
async with ReeveClient(api_url="https://api.reeve.example.com") as client:
# Login manually
login_response = await client.auth.login(
username="admin",
password="password123"
)
print(f"Token: {login_response.token}")
print(f"Expires: {login_response.expires_at}")
User Registration (Admin only)
async with ReeveClient(
api_url="https://api.reeve.example.com",
api_key="admin-token"
) as client:
response = await client.auth.register(
username="newuser",
email="user@example.com",
password="secure-password",
role="User"
)
print(response.message)
Change Password
async with ReeveClient(
api_url="https://api.reeve.example.com",
api_key="user-token"
) as client:
response = await client.auth.change_password(
current_password="old-password",
new_password="new-password"
)
print(response.message)
API Documentation
Full API specification is available in docs/swagger.json.
Testing
Run tests with:
pytest
Or with tox for comprehensive testing:
tox
Note
This project has been set up using PyScaffold 4.6. For details and usage information on PyScaffold see https://pyscaffold.org/.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file reeve_python_sdk-0.2.0.tar.gz.
File metadata
- Download URL: reeve_python_sdk-0.2.0.tar.gz
- Upload date:
- Size: 32.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7c543b46a128bc26b5d508729635133b3b67d5bb82ef9fe5c45f7adaec1a3af1
|
|
| MD5 |
6f4bb4a99c610117c2fab99727b92854
|
|
| BLAKE2b-256 |
a8c475917fa256425dfb0f0921fbca69e3b14f20a8882ca9d44c45e166ba938e
|
File details
Details for the file reeve_python_sdk-0.2.0-py3-none-any.whl.
File metadata
- Download URL: reeve_python_sdk-0.2.0-py3-none-any.whl
- Upload date:
- Size: 14.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7b28805d2a4156174884508a62b3fbcaae0d8580dea2b722507575f2bf67e563
|
|
| MD5 |
468e8ea7107aa4e4c574c387244dc2f0
|
|
| BLAKE2b-256 |
1b51097076f7a2c6f6b50b73976573b0e263e522f11bb79b2daa6cec3f90a0ea
|