Skip to main content

autoxkit

PyPI version Python Version License

一个轻量级的 python 自动化库,支持 Windows 前后台键鼠操作、图像识别、全局 hook 监听等,Android 模块基于 scrcpy-server v4.0 协议支持 Android 无线/有线投屏、键鼠映射等功能。 适用于自动化脚本、软件测试、人机交互等多种场景。


功能特色

  • 前后台键鼠操作
  • 前后台图像识别
  • 文本输入模拟
  • 全局键鼠 hook 监听
  • Android 无线/有线投屏
  • Android 键鼠映射

Android 模块依赖于 scrcpy v4.0 ,请自行前往 scrcpy v4.0 下载 scrcpy-win64-v4.0.zip 文件。


安装方式

从 PyPI 安装:

pip install autoxkit

或下载源码后本地安装:

pip install .

示例代码

"""
return Any or not return 只监听事件,不阻止事件传播

return True 监听事件,并阻止事件传播,可以理解为下一个窗口不会收到该事件
"""

from autoxkit.hook import HookListener, KeyEvent, MouseEvent

def key_down(event: KeyEvent):
    print(event.action, event.key_code, event.key_name)
    if event.key_name == 'A':
        print("A键将被阻止传播,其他窗口将无法接收到该事件")
        return True
    return False

def key_up(event: KeyEvent):
    print(event.action, event.key_code, event.key_name)
    return False

def mouse_down(event: MouseEvent):
    print(event.action, event.button, event.position)
    return False

def mouse_up(event: MouseEvent):
    print(event.action, event.button, event.position)
    return False


def mouse_move(event: MouseEvent):
    print(event.action, event.button, event.position)
    return False


hook_listener = HookListener()
hook_listener.add_handler('keydown', key_down)
hook_listener.add_handler('keyup', key_up)
hook_listener.add_handler('mousedown', mouse_down)
hook_listener.add_handler('mouseup', mouse_up)
hook_listener.add_handler('mousemove', mouse_move)
hook_listener.start()

print("当前鼠标位置:", hook_listener.get_mouse_position())

if __name__ == '__main__':
    try:
        hook_listener.wait()
    except Exception:
        hook_listener.stop()

更多示例代码请参考 examples


GitHub 项目地址

https://github.com/YorickFin/autoxkit


License

本项目基于 GPL-3.0 许可开源,欢迎使用与二次开发。

Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

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

autoxkit-2.4.6-cp313-cp313-win_amd64.whl (66.1 kB view details)

Uploaded CPython 3.13Windows x86-64

autoxkit-2.4.6-cp312-cp312-win_amd64.whl (66.1 kB view details)

Uploaded CPython 3.12Windows x86-64

autoxkit-2.4.6-cp311-cp311-win_amd64.whl (66.1 kB view details)

Uploaded CPython 3.11Windows x86-64

autoxkit-2.4.6-cp310-cp310-win_amd64.whl (66.1 kB view details)

Uploaded CPython 3.10Windows x86-64

File details

Details for the file autoxkit-2.4.6-cp313-cp313-win_amd64.whl.

File metadata

  • Download URL: autoxkit-2.4.6-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 66.1 kB
  • Tags: CPython 3.13, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.18

File hashes

Hashes for autoxkit-2.4.6-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 6d9b9d9ac7e677ab18119e9934c0bf622c313f9cc098e71607bd237636b05246
MD5 a3720aaace03877aff8d55cedeb48b9e
BLAKE2b-256 2de6a9313fc9c61870412f2f4783495fcc0f6b3f2d07bfea0f7a62278a6c4d12

See more details on using hashes here.

File details

Details for the file autoxkit-2.4.6-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: autoxkit-2.4.6-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 66.1 kB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.18

File hashes

Hashes for autoxkit-2.4.6-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 d5bb67d7666d5d633c9ebdf9fa8ef426485ae76757e8cb12ad61fdd5356830bb
MD5 acc445b7391227c004d35458fdbe27ef
BLAKE2b-256 9195f9dc92787871a962f950b9884a63d02d1755705ca76f978e374ccd335b0a

See more details on using hashes here.

File details

Details for the file autoxkit-2.4.6-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: autoxkit-2.4.6-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 66.1 kB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.18

File hashes

Hashes for autoxkit-2.4.6-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 2be9d2f0735014778e659b7f34b3241031b7dd90d97d32fcfff3e16ab7b0ad9f
MD5 ad2d6a30faaebf44c8e96ea3157599f9
BLAKE2b-256 a6f5afa9dbc70a54045a1484a1d48de706191625fefa4a7819439d2bcbd8f2e7

See more details on using hashes here.

File details

Details for the file autoxkit-2.4.6-cp310-cp310-win_amd64.whl.

File metadata

  • Download URL: autoxkit-2.4.6-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 66.1 kB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.18

File hashes

Hashes for autoxkit-2.4.6-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 411f2579459646a2951d3fd2a344001703ea2bafb7344261edb86596e49660c5
MD5 0275a6da3abdd2516fd9481f27504816
BLAKE2b-256 8c66befeae13aa5535947cefe8c9c5e2df36ce0e67f104862ba3ad069339f9a1

See more details on using hashes here.

Release history Release notifications | RSS feed

2.4.9

2 files

2.4.8

2 files

2.4.7

4 files

This release

2.4.6 This release

4 files

2.4.5

2 files

2.4.4

2 files

2.4.3

2 files

2.4.2

2 files

2.4.1

2 files

2.4.0

2 files

2.3.0

2 files

2.2.1

2 files

2.2.0

2 files

2.1.1

2 files

2.1.0

2 files

2.0.1

2 files

2.0.0

2 files

1.1.6

2 files

1.1.5

2 files

1.1.4

2 files

1.1.3

2 files

1.1.2

2 files

1.1.1

2 files

1.1.0

2 files

1.0.0

2 files

0.9.0

2 files

0.8.0

2 files

0.7.1

2 files

0.7.0

2 files

0.6.9

2 files

0.6.8

2 files

0.6.7

2 files

0.6.6

2 files

0.6.5

2 files

0.6.4

2 files

0.6.3

2 files

0.6.2

2 files

0.6.1

2 files

0.6.0

2 files

0.5.5

2 files

0.5.4

2 files

0.5.2

2 files

0.5.0

2 files

0.4.7

2 files

0.4.6

2 files

0.4.5

2 files

0.4.4

2 files

0.4.3

2 files

0.4.2

2 files

0.4.1

2 files

0.3.1

2 files

0.2.1

2 files

0.1.1

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