Skip to main content

Official Python SDK for the Reversal Engine API

Project description

Reversal SDK — Python

Client Python officiel pour l'API Reversal Engine.

Installation

pip install reversal-sdk

Ou depuis les sources :

pip install ./sdk/python

Démarrage rapide

from reversal_sdk import ReversalClient

client = ReversalClient(api_key="sk-rev-...")

# Analyser une URL
result = client.reverse("https://example.com")
print(result["content_type"], result["content"])

# Analyser un fichier local (upload automatique)
result = client.reverse("rapport.pdf")

# Mode asynchrone — soumettre un job
job = client.submit_job("gros-fichier.pdf")
# … attendre le résultat en polling
result = client.wait_for_job(job["job_id"])

# Ou streamer les événements en temps réel
for event in client.stream_job(job["job_id"]):
    print(event["event"], event["data"])

# Uploader un fichier manuellement
info = client.upload("document.pdf")
result = client.reverse(f"file:{info['file_id']}")

# Batch (jusqu'à 10 sources)
results = client.batch(["https://a.com", "https://b.com"])

# Infos compte
me = client.me()
print(me["plan"], me["usage"], "/", me["quota"])

Référence API

Méthode Description
reverse(source, *, async_mode, extra) Parse une source, retourne le résultat structuré
submit_job(source) Équivalent à reverse(..., async_mode=True)
wait_for_job(job_id, *, poll_interval, timeout) Polling jusqu'à done ou failed
get_job(job_id) Récupère l'état courant d'un job
stream_job(job_id) Générateur d'événements SSE
upload(path) Upload un fichier local
batch(sources, *, async_mode) Parse plusieurs sources en une requête
detect(source) Détecte le type sans parser
delete_file(file_id) Supprime un fichier uploadé
me() Infos compte (plan, usage, quota)

Exceptions

from reversal_sdk import (
    ReversalError,   # base
    AuthError,       # 401 / 403
    NotFoundError,   # 404
    RateLimitError,  # 429
    QuotaError,      # 402
    ServerError,     # 5xx
)

Variables d'environnement

Variable Description
REVERSAL_API_KEY Clé API (alternative à api_key=)

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

reversal_sdk-1.1.4.tar.gz (7.6 kB view details)

Uploaded Source

Built Distribution

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

reversal_sdk-1.1.4-py3-none-any.whl (7.3 kB view details)

Uploaded Python 3

File details

Details for the file reversal_sdk-1.1.4.tar.gz.

File metadata

  • Download URL: reversal_sdk-1.1.4.tar.gz
  • Upload date:
  • Size: 7.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for reversal_sdk-1.1.4.tar.gz
Algorithm Hash digest
SHA256 d670c57eab90d25328c38d2e56135df69c78915ee852d531c12ca0fcb584c6f9
MD5 e827d7eea08a4536eecd2f8892796035
BLAKE2b-256 2433267fe89b4070a0bfba0371ea8728eb4e6d290f4563535938d000a930da23

See more details on using hashes here.

File details

Details for the file reversal_sdk-1.1.4-py3-none-any.whl.

File metadata

  • Download URL: reversal_sdk-1.1.4-py3-none-any.whl
  • Upload date:
  • Size: 7.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for reversal_sdk-1.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 b08761afd45518c83bc99ab57d64aadf58b4507b3874213579a4a377e40af962
MD5 315548f92f13239e7871de9c80b3b64f
BLAKE2b-256 fedbe5035f909c18077d9ea3a463c8b16ec8aab8b497a1ac06154a62142cc73f

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