semvec/pypi-packages huggingface dataset:
revrseai-python 0.1.1
Python RevrseAI client library
License: MIT
Requires Python: >=3.11
Keywords: android, api, automation, client, revrseai, sdk

# RevrseAI Python Library

[![pypi](https://img.shields.io/badge/pypi-v0.1.0-blue.svg)](https://pypi.python.org/pypi/revrseai-python)

A Python client library for interacting with the RevrseAI API. Generate APIs for any Android app using a single prompt — extract data, automate tasks, and build integrations without an emulator. Generated endpoints are deterministic and don't rely on an LLM or emulator at execution time, making them extremely fast, cheap, and stable.

## Getting an API Key

To use this library, you'll need an API key:

1. Go to [https://revrse.ai](https://revrse.ai)
2. Login or sign up for an account
3. Navigate to the Settings page
4. Generate your API key

## Installation

```sh
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 settings page. Set it directly or use the `REVRSE_AI_API_KEY`
environment variable:

```python
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:

```python
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:**

```python
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:**

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

**By app name and endpoint:**

```python
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:

```python
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:

```python
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")
```