Skip to main content

Python RevrseAI client library

Project description

RevrseAI Python Library

pypi

The RevrseAI Python library provides convenient access to the RevrseAI API from applications written in Python. It allows you to generate APIs for any Android app using natural language and execute those APIs programmatically.

Installation

pip install revrseai-python

Requirements

  • Python 3.11+

Usage

The library needs to be configured with your account's API key which is available in your RevrseAI Dashboard. Set it directly or use the REVRSE_AI_API_KEY environment variable:

from revrseai import RevrseAI

client = RevrseAI("your_api_key")

Generate an API

Generate an API for any Android app by describing what you want to do:

from revrseai import RevrseAI

client = RevrseAI("your_api_key")

task = client.generate(
    "Log into Job Today and get the jobs on my feed",
    secrets={
        "username": "your_username",
        "password": "your_password"
    }
)

# Wait for generation to complete
result = task.wait_till_done()

# Print the generated API documentation
result.print_markdown_documentation()

Execute an Endpoint

Execute endpoints using one of three methods:

By endpoint ID:

result = client.execute(
    endpoint_id="<endpoint_id>",
    data={"username": "your_username", "password": "your_password"}
)
print(result.status)
print(result.data)

By task ID and endpoint name:

result = client.execute(
    task_id="<task_id>",
    endpoint="login",
    data={"username": "your_username", "password": "your_password"}
)

By app name and endpoint:

result = client.execute(
    app="Job Today",
    endpoint="login",
    data={"username": "your_username", "password": "your_password"}
)

Get App Info

Retrieve information about existing endpoints for an app:

info = client.info("Job Today")

# Print available endpoints
info.print_markdown_documentation()

# Execute an endpoint directly
endpoint = info.endpoints[0]
result = endpoint.execute(data={"key": "value"})

Export Documentation

Export generated API documentation to a file:

task = client.generate("Natural language instructions to perform the task")
result = task.wait_till_done()

# Export to markdown file
result.export_markdown_documentation("api_docs.md")

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

revrseai_python-0.1.0.tar.gz (25.6 kB view details)

Uploaded Source

Built Distribution

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

revrseai_python-0.1.0-py3-none-any.whl (10.1 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for revrseai_python-0.1.0.tar.gz
Algorithm Hash digest
SHA256 b6e75d95c58285c536f694eaaf0efdf2a612d3bbe7c4bc0df16a1ffbb095de22
MD5 f9cdd39b8b785bb41c2c4de04b3b6b26
BLAKE2b-256 e223cbfb46353c5f06d4155dd744ecb2b0f91f21b379ad30cb3ec58db0e92291

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for revrseai_python-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b1f3bb01616d5f58e548654cbd4a5f88907108787149d413a1b3eff152d9e738
MD5 7edf76fd05473e190577118b64ae4468
BLAKE2b-256 a08dcc7d2b2d681e9c4b592888ab9f8ad3d1bb1cbd337e4d5d8cd72a4031b402

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