Skip to main content

SMA AutoUI

https://pypi.org/project/sma-autoui/

智能移动自动化 UI 框架

🚀 快速开始

# 从 PyPI 安装
pip install sma-autoui

# 或从源码安装
pip install .

🌟 核心特性

  • 多平台适配: 支持多个社交平台 API 集成
  • Session 复用: 跨任务会话管理架构
  • 视觉匹配: SIFT + OCR 双模式识别
  • ADB 直达: 浏览器链接直接跳转设计
  • AI 驱动: LLM 接口封装
  • 自愈能力: UI 异常诊断与自动恢复

📦 项目结构

框架核心层 (sma_autoui/)

Driver 层 - 设备交互与自动化驱动

  • driver/ - ADB/Appium/Vision 三层驱动
  • actions.py - 动作执行(点击/滑动/按键)
  • locator.py - 元素定位与查找
  • automator.py - Appium Session 管理
  • vision.py - 视觉识别与图像处理
  • browser.py - 浏览器控制

Vision 层 - 纯视觉分析能力

  • vision/ - SIFT/模板匹配/OCR
  • business_matchers/ - 业务图像匹配器
  • assets/ - 平台图标资源库

LLM 层 - 大模型交互封装

  • llm/ - API 调用与提示词管理
  • client.py - 模型请求与 Token 统计
  • parser.py - 结果解析与后处理

Common 层 - 零业务依赖工具集

  • common/ - 通用工具函数库
  • config.py - 全局配置管理
  • logger.py - 日志系统
  • notifier.py - 飞书通知
  • uploader.py - 文件上传服务

Platform 层 - 平台业务逻辑抽象

  • platform/ - 平台级公共功能
  • tiktok/ - TikTok 平台实现
  • fb/ - Facebook 平台实现
  • wa/ - WhatsApp 平台实现

Engine 层 - 运行时调度与编排

  • engine/ - 任务调度框架
  • runner.py - TaskRunner(重试/保活/追踪)
  • recovery.py - RecoveryController(自愈策略)

Flows 层 - AI 认知工作流

  • flows/ - AI 任务管线
  • base_flow.py - Flow 基类
  • gen_comment_flow.py - 评论生成工作流
  • diagnosis_flow.py - 异常诊断工作流

Store 层 - 数据持久化

  • store/ - 规则与缓存存储
  • rule_store.py - 规则 CRUD
  • default_rules_*.json - 默认规则集

📖 文档说明

完整文档请查看 docs 文件夹:

文档 用途
🛠️ 配置指南 环境搭建与验证
🏗️ 系统架构 系统设计 & 模块结构
💡 点击机制 ADB vs Appium vs W3C Actions
⚠️ 常见问题 常见错误与解决方案
🛣️ 路线图 开发计划

💻 使用示例

# 基本使用流程示例
from sma_autoui.driver import Driver, Device

# 1. 初始化设备
device = Device(device_name="172.25.2.20:5555", adb_port=5002)

# 2. 创建驱动实例
driver = Driver(
    device=device,
    appium_url="http://localhost:4723/wd/hub",
    task_name="example_task"
)

# 3. 使用高级 API
driver.smart_find(locators=[...], timeout=10)
driver.tap_by_adb(x=500, y=800)

# 4. 任务自动重试与保活
# TaskRunner 会处理异常恢复和 Session 管理

详细使用请参考各模块文档。

🔧 从源码安装

git clone https://github.com/Fun-Fox/sma_autoui.git
cd sma_autoui
pip install -r requirements.txt
pip install -e .

📄 开源协议

MIT License


Built with ❤️ by FunFox

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sma_autoui-0.2.4.tar.gz (2.5 MB view details)

Uploaded Source

Built Distribution

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

sma_autoui-0.2.4-py3-none-any.whl (2.6 MB view details)

Uploaded Python 3

File details

Details for the file sma_autoui-0.2.4.tar.gz.

File metadata

  • Download URL: sma_autoui-0.2.4.tar.gz
  • Upload date:
  • Size: 2.5 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.12.9

File hashes

Hashes for sma_autoui-0.2.4.tar.gz
Algorithm Hash digest
SHA256 3bdb24a57c8470a81ce18af34576917a38f1c28e9b2621bb27469c9b1b02485d
MD5 78f9b1aa6e5b7918c2f457d92269dc50
BLAKE2b-256 7c5aaa91998bfd9f69e585e48b38c903a877d7a34ecae2f6aff889ab90cfd8bd

See more details on using hashes here.

File details

Details for the file sma_autoui-0.2.4-py3-none-any.whl.

File metadata

  • Download URL: sma_autoui-0.2.4-py3-none-any.whl
  • Upload date:
  • Size: 2.6 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.12.9

File hashes

Hashes for sma_autoui-0.2.4-py3-none-any.whl
Algorithm Hash digest
SHA256 bb964f18fcfbf77072bb6e8a3afc87624e930d3b62647e837fba663cc3a76498
MD5 6eac9c4865ed5c6448ff6955c19658b0
BLAKE2b-256 bacd7950739d64fed144ae2361201698fa61f510cb4112089d00c30926826df7

See more details on using hashes here.

Release history Release notifications | RSS feed

0.3.2

2 files

0.3.1

2 files

0.3.0

2 files

0.2.9

2 files

0.2.8

2 files

0.2.7

2 files

0.2.6

2 files

0.2.5

2 files

This release

0.2.4 This release

2 files

0.2.3

2 files

0.2.2

2 files

0.2.1

2 files

0.2.0

2 files

0.1.9

2 files

0.1.8

2 files

0.1.7

2 files

0.1.6

2 files

0.1.5

2 files

0.1.4

2 files

0.1.3

2 files

0.1.2

2 files

0.1.1

2 files

0.1.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page