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

Uploaded Python 3

File details

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

File metadata

  • Download URL: reversal_sdk-1.0.2.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.0.2.tar.gz
Algorithm Hash digest
SHA256 32bdfa5262a8b0f8d438c16d87ffd24dbb2e894e457214adf9e633209705ef93
MD5 7bed9708e264c094faa784d863d7da89
BLAKE2b-256 3d2a9f1156f34f1c80abe68ac7c2526a9f20a02e3945d2000ec1731835ee9db3

See more details on using hashes here.

Provenance

The following attestation bundles were made for reversal_sdk-1.0.2.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.0.2-py3-none-any.whl.

File metadata

  • Download URL: reversal_sdk-1.0.2-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.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 b0d4be1cdf5c19fa968f9045e07946cc6cdb3f5ee2a498406f5f2cd390aaae62
MD5 9a1f9d0d97e8f4cbf97383c7be2cb2dd
BLAKE2b-256 02761c6f3654ddfd99f62ff0eea6f40331b5772697f6262def4528f8e1272a26

See more details on using hashes here.

Provenance

The following attestation bundles were made for reversal_sdk-1.0.2-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