Metadata-Version: 2.4
Name: appwire
Version: 0.1.5
Summary: Build and push Taps to AppWire — reverse-engineered mobile app API wrappers for workflow automation
Author: AppWire
License: MIT
Project-URL: Homepage, https://appwire.dev
Project-URL: Documentation, https://appwire.dev/developers/sdk
Project-URL: Repository, https://github.com/appwire-dev/appwire-sdk
Keywords: automation,api,mobile,workflow,reverse-engineering
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Software Development :: Libraries
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: pyyaml>=6.0
Requires-Dist: requests>=2.28.0
Dynamic: license-file

# AppWire SDK

Build and push **Taps** to [AppWire](https://appwire.dev) — reverse-engineered mobile app API wrappers for workflow automation.

A **Tap** wraps a mobile app's internal API into reusable actions. Each action maps to an HTTP endpoint with headers, params, and response mappings.

## Install

```bash
pip install appwire
```

## Quick Start

```python
from appwire import Tap

tap = Tap(
    name="TikTok Profile Scraper",
    app="TikTok",
    version="1.0.0",
    description="Fetch profile data from TikTok's internal API",
)

@tap.action(
    name="Get Profile",
    method="GET",
    endpoint="https://api.tiktok.com/api/user/detail",
)
def get_profile(username: str):
    return {
        "params": {"uniqueId": username},
        "headers": {
            "User-Agent": "TikTok/26.1.3",
        },
    }
```

## CLI

```bash
appwire login              # Authenticate
appwire init my-tap        # Scaffold a new Tap project
appwire validate           # Validate before pushing
appwire push               # Push to AppWire
appwire list               # List your published Taps
```

## Tap Manifest

Every Tap has a `tap.yaml` manifest:

```yaml
name: "TikTok Profile Scraper"
description: "Fetch profile data from TikTok"
version: "1.0.0"
app: "TikTok"
icon: "./icon.png"
entry: "main.py"
```

## Credentials

Reference user credentials with `{{credential:name}}` placeholders:

```python
tap = Tap(
    name="My Tap",
    app="MyApp",
    version="1.0.0",
    credentials=[
        {"name": "session_id", "label": "Session ID", "required": True},
    ],
)

@tap.action(name="Get Data", method="GET", endpoint="/api/data")
def get_data():
    return {
        "headers": {
            "Cookie": "sid={{credential:session_id}}",
        },
    }
```

## Response Mapping

Extract fields from API responses using JSONPath:

```python
@tap.action(
    name="Get Profile",
    method="GET",
    endpoint="/api/user/detail",
    response_mapping={
        "username": "$.userInfo.user.uniqueId",
        "followers": "$.userInfo.stats.followerCount",
    },
)
def get_profile(username: str):
    return {"params": {"uniqueId": username}}
```

## License

MIT
