Skip to main content

Robot Platform API SDK

Project description

Robot Platform SDK (Python)

Python SDK for Robot Platform with:

  • develop-app authentication (app_id/app_secret),
  • sync + async clients,
  • auto token refresh,
  • robot operations and login/hardening task flow.

Installation

pip install robot-wrapper-sdk

Configuration

Set environment variables (recommended):

  • ROBOT_PLATFORM_BASE_URL
  • ROBOT_PLATFORM_APP_ID
  • ROBOT_PLATFORM_APP_SECRET
  • ROBOT_PLATFORM_PROXY_URL (optional)

Or pass values directly when creating the module.


Quick Start (Sync)

from robot_sdk import RobotPlatformModule

sdk = RobotPlatformModule(
    base_url="http://localhost:8085",
    app_id="your_app_id",
    app_secret="your_app_secret",
    # proxy_url="socks5h://192.168.3.100:1080",  # optional
)

# Read robot
robot = sdk.get_robot("2047631542552334336")
print(robot.platform if robot else "not found")

# Update lifecycle status
sdk.update_status("2047631542552334336", "live")

# Acquire login tasks
login_tasks = sdk.acquire_need_login(limit=20, lock_minutes=30)

# Update auth status after worker result
sdk.update_auth_status("2047631542552334336", "authorized")
# allowed values: authorized | unauthorized | logged_out

# Acquire hardening tasks
hardening_tasks = sdk.acquire_unhardened(limit=20, lock_minutes=30, min_age_days=0)

# Update hardening status after worker result
sdk.update_security_hardened("2047631542552334336", True)

sdk.close()

Quick Start (Async)

import asyncio
from robot_sdk import AsyncRobotPlatformModule

async def main():
    sdk = AsyncRobotPlatformModule(
        base_url="http://localhost:8085",
        app_id="your_app_id",
        app_secret="your_app_secret",
    )

    robot = await sdk.get_robot("2047631542552334336")
    print(robot.platform if robot else "not found")

    await sdk.update_auth_status("2047631542552334336", "authorized")
    await sdk.update_security_hardened("2047631542552334336", True)

    await sdk.close()

asyncio.run(main())

Response Shape (Placeholder)

Acquire endpoints return:

{
  "status": "success",
  "code": 200,
  "message": "OK",
  "data": [
    {
      "id": "2047631542552334336",
      "username": "example_user_1",
      "platform": "facebook",
      "status": "live",
      "auth_status": "unauthorized",
      "metadata": {
        "security_hardened": false
      }
    }
  ]
}

Update endpoints return:

{
  "status": "success",
  "code": 200,
  "message": "OK",
  "data": null
}

Main API

RobotPlatformModule (sync)

  • list_robots(platform=None, status=None, project_id=None, page=1, limit=20)
  • get_robot(robot_id)
  • delete_robot(robot_id)
  • get_secrets(robot_id)
  • update_status(robot_id, status)
  • acquire_need_login(limit=20, lock_minutes=30)
  • acquire_unhardened(limit=20, lock_minutes=30, min_age_days=0)
  • update_auth_status(robot_id, auth_status)
  • update_security_hardened(robot_id, security_hardened)
  • close()

AsyncRobotPlatformModule (async)

Async equivalents of all methods above, plus await close().


Documentation


Build & Publish (Maintainers)

make venv
make install
make build
make publish

Requires valid PyPI credentials (Twine).

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

robot_wrapper_sdk-0.2.7.tar.gz (8.4 kB view details)

Uploaded Source

Built Distribution

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

robot_wrapper_sdk-0.2.7-py3-none-any.whl (10.1 kB view details)

Uploaded Python 3

File details

Details for the file robot_wrapper_sdk-0.2.7.tar.gz.

File metadata

  • Download URL: robot_wrapper_sdk-0.2.7.tar.gz
  • Upload date:
  • Size: 8.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for robot_wrapper_sdk-0.2.7.tar.gz
Algorithm Hash digest
SHA256 623dd99da7b6e77852ae188346b4a28b5f0e7187376a4366aa79716561d9170e
MD5 1747f9c5ec8cc27f95485be778d53ef4
BLAKE2b-256 cfc8a529bc36c24201c7e37f33b9c6b16f1ae0df957c45f70baab17a6acf0226

See more details on using hashes here.

File details

Details for the file robot_wrapper_sdk-0.2.7-py3-none-any.whl.

File metadata

File hashes

Hashes for robot_wrapper_sdk-0.2.7-py3-none-any.whl
Algorithm Hash digest
SHA256 84c5ec4e22d8bc1d9ae3559f2d3ca71760987134fd4bf45116feadac6cb8869e
MD5 4c93649869d290cbb8ad6bd2fa6a634f
BLAKE2b-256 6ae0ec56cf9affae862f69f98e24899ec0d7534e5080099bb10a1119a0efaa12

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