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.1.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.1-py3-none-any.whl (7.3 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for reversal_sdk-1.1.1.tar.gz
Algorithm Hash digest
SHA256 ab0fe5cf730e97a7a70e8727ff68deadf24ce44fa7c56908272cd1a5b0a675ca
MD5 7555246dfaa47468e9a99361e13b756e
BLAKE2b-256 2a35221252cd69303a521ea63ba4fa96a3b7bddce854b4dd7a2fc622f62e3354

See more details on using hashes here.

Provenance

The following attestation bundles were made for reversal_sdk-1.1.1.tar.gz:

Publisher: publish.yml on Etytabs/REVERSAL

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

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

File metadata

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

File hashes

Hashes for reversal_sdk-1.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 fe3aeb0eb2503a96b04ea2a6bfcf41d6febfcf5f280ad0e202f7a7f2ba4d2115
MD5 2d9a946f0af35d424b15288f177cc24e
BLAKE2b-256 f14d7324a112d36b4720878c291457fcbc0176cefeb786e0e8c79e155a7aa2b8

See more details on using hashes here.

Provenance

The following attestation bundles were made for reversal_sdk-1.1.1-py3-none-any.whl:

Publisher: publish.yml on Etytabs/REVERSAL

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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