Skip to main content

Production-grade Python SDK for Zora AI Email fraud/phishing detection APIs

Project description

zora-ai-email-sdk

Production-grade async Python SDK for the Zora AI Email Fraud Detection API.

Features

  • Analyse raw emails (sender + subject + body) for phishing / fraud
  • Optional LLM-powered explanation
  • Rich result dataclass: risk_score, fraud_type, confidence, sub-scores, similarity, LLM fields
  • Automatic retries with exponential back-off
  • Async-first (httpx) with async with / aclose() support

Installation

pip install -e packages/email_package   # editable local install

Quick Start

import asyncio
from zora_ai_email import ZoraAIEmailClient, EmailAnalyzer

async def main():
    async with ZoraAIEmailClient(api_key="zora_...") as client:
        analyzer = EmailAnalyzer(client)
        result = await analyzer.analyze(
            sender="offers@totally-real-bank.xyz",
            subject="Urgent: Verify your account",
            body="Click here immediately to avoid suspension: http://evil.xyz/login",
            with_llm_explanation=True,
        )
        print(result.risk_score, result.fraud_type, result.llm_explanation)

asyncio.run(main())

API Reference

ZoraAIEmailClient

Parameter Type Default Description
api_key str required Your Zora AI API key
base_url str http://localhost:8000 API base URL
timeout float 30.0 Request timeout in seconds
max_retries int 3 Number of retry attempts
backoff_factor float 0.5 Exponential back-off base

EmailAnalyzer.analyze(sender, subject, body, *, with_llm_explanation)

Returns an EmailAnalysisResult dataclass.

EmailAnalysisResult fields

Field Type Description
request_id str | None UUID of the stored analysis
message_id str Echo of the message_id
sender str Sender address
subject str Email subject
body str Body preview (truncated by server)
risk_score float 0–1 overall threat score
fraud_type str e.g. phishing, safe
confidence float Model confidence 0–1
sub_scores dict nlp_score, similarity_score, stylometry_score
llm_enhanced bool Whether LLM explanation was generated
llm_explanation str | None Human-readable explanation
llm_label str | None LLM verdict label
llm_confidence float | None LLM confidence
similarity dict Raw similarity search result
nlp_prediction dict Raw NLP model prediction
raw_response dict Full API response

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

zora_ai_email_sdk-0.1.0.tar.gz (8.1 kB view details)

Uploaded Source

Built Distribution

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

zora_ai_email_sdk-0.1.0-py3-none-any.whl (8.5 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for zora_ai_email_sdk-0.1.0.tar.gz
Algorithm Hash digest
SHA256 b96df1c961c7710a4f0bfad66e34a08c159a4176fc6fe42411b45d0c108745c1
MD5 4a8b84731c4f769a9284c77121e04817
BLAKE2b-256 e01358da0009aec174ad0eb5ce15413e3bba18c2cbe47057566995de2b17fa30

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for zora_ai_email_sdk-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9d4c4c3c6d5d647f5f40d3ccd65d714b77d283973d5c3760b4231be0dca52315
MD5 e867e07327a8f558cb8747e394b33b3b
BLAKE2b-256 98f973b2a08f146be60d99a8f3558906f646f4956eb809215690440b53e071ef

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