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

Uploaded Python 3

File details

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

File metadata

  • Download URL: reversal_sdk-1.0.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.0.1.tar.gz
Algorithm Hash digest
SHA256 2ec328dd5f24f7185f638eae6081fc6adcc9f356fce77d797f422ae521c295c3
MD5 011fd81fc9da6a58b4be608241cce58d
BLAKE2b-256 12dd6dfef3ca8e8c5c9c9695e7268ea06344469ffb9224dab98ccf7c873ef75f

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: reversal_sdk-1.0.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.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 1b4254b9c5325a5c1516f1e0b6caacde560f54d1a6143caeb5b8c6a2639fac68
MD5 cd5a2730f76273b012dde5009e67c1f2
BLAKE2b-256 bb198033c92c60ab81ac21e6096d206dc71ac2313ea17ec68f0c926329846ea3

See more details on using hashes here.

Provenance

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