Python SDK
revieve-sdk — a thin, typed client for analyze_image. Source lives in sdks/python/.
Install
Section titled “Install”pip install revieve-sdkRequires Python 3.10+. Depends on httpx.
Quick start
Section titled “Quick start”from revieve import SkinAnalysisClient
revieve = SkinAnalysisClient(partner_id="jmlv6b2qtS")
with open("selfie.jpg", "rb") as f: result = revieve.analyze_image( image=f, components=["wrinkles", "redness", "skin_age"], gender="unknown", skintone=0, )
print(result["message"], len(result["results"]))Errors
Section titled “Errors”from revieve import RevieveAnalysisError, RevieveNetworkError
try: result = revieve.analyze_image(image=f)except RevieveAnalysisError as err: print(err.first_error_idx, err)except RevieveNetworkError: raiseAsync / sync
Section titled “Async / sync”The v0.1 client is synchronous. An AsyncSkinAnalysisClient is on the roadmap; in the meantime, run sync calls in a thread pool from your async app:
import asyncioimport functools
async def analyze(image_path: str): return await asyncio.to_thread( functools.partial(revieve.analyze_image, image=open(image_path, "rb")) )Test fixture injection
Section titled “Test fixture injection”Pass a configured httpx.Client for unit testing, retries, or proxies:
import httpx
mock = httpx.Client(transport=httpx.MockTransport(handler))revieve = SkinAnalysisClient(partner_id="test", http_client=mock)