pyautoscene 0.1.0__py3-none-any.whl → 0.2.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- pyautoscene/__init__.py +2 -2
- pyautoscene/ocr.py +70 -0
- pyautoscene/ocr_config.yaml +112 -0
- pyautoscene/references.py +54 -14
- pyautoscene/scene.py +5 -5
- pyautoscene/screen.py +79 -0
- pyautoscene/session.py +2 -2
- {pyautoscene-0.1.0.dist-info → pyautoscene-0.2.0.dist-info}/METADATA +38 -17
- pyautoscene-0.2.0.dist-info/RECORD +13 -0
- pyautoscene-0.2.0.dist-info/licenses/LICENSE +201 -0
- pyautoscene-0.1.0.dist-info/RECORD +0 -9
- {pyautoscene-0.1.0.dist-info → pyautoscene-0.2.0.dist-info}/WHEEL +0 -0
- {pyautoscene-0.1.0.dist-info → pyautoscene-0.2.0.dist-info}/entry_points.txt +0 -0
pyautoscene/__init__.py
CHANGED
@@ -1,5 +1,5 @@
|
|
1
|
-
from .references import
|
1
|
+
from .references import ImageElement, TextElement
|
2
2
|
from .scene import Scene
|
3
3
|
from .session import Session
|
4
4
|
|
5
|
-
__all__ = ["Scene", "Session", "
|
5
|
+
__all__ = ["Scene", "Session", "ImageElement", "TextElement"]
|
pyautoscene/ocr.py
ADDED
@@ -0,0 +1,70 @@
|
|
1
|
+
import logging
|
2
|
+
from hashlib import sha256
|
3
|
+
from pathlib import Path
|
4
|
+
|
5
|
+
import numpy as np
|
6
|
+
from PIL import Image
|
7
|
+
|
8
|
+
from .screen import Region
|
9
|
+
|
10
|
+
logging.basicConfig(level=logging.INFO)
|
11
|
+
logger = logging.getLogger(__name__)
|
12
|
+
|
13
|
+
try:
|
14
|
+
from rapidocr import RapidOCR
|
15
|
+
from rapidocr.utils.output import RapidOCROutput
|
16
|
+
except ImportError:
|
17
|
+
raise ImportError(
|
18
|
+
"RapidOCR is not installed. Please install it using 'pip install pyautoscene[ocr]'."
|
19
|
+
)
|
20
|
+
|
21
|
+
ocr_config_path = Path(__file__).parent / "ocr_config.yaml"
|
22
|
+
|
23
|
+
|
24
|
+
def hash_image(img: Image.Image) -> str:
|
25
|
+
return sha256(img.tobytes()).hexdigest()
|
26
|
+
|
27
|
+
|
28
|
+
def convert_points_to_ltwh(points: np.ndarray) -> Region:
|
29
|
+
if points.shape[0] == 0:
|
30
|
+
raise ValueError("Points array is empty")
|
31
|
+
|
32
|
+
x_min = np.min(points[:, 0])
|
33
|
+
y_min = np.min(points[:, 1])
|
34
|
+
x_max = np.max(points[:, 0])
|
35
|
+
y_max = np.max(points[:, 1])
|
36
|
+
|
37
|
+
return Region(left=x_min, top=y_min, width=x_max - x_min, height=y_max - y_min)
|
38
|
+
|
39
|
+
|
40
|
+
class OCR:
|
41
|
+
engine: RapidOCR | None = None
|
42
|
+
img_cache: dict[str, tuple[tuple[str, Region], ...]] = {}
|
43
|
+
|
44
|
+
def __new__(cls):
|
45
|
+
if cls.engine is None:
|
46
|
+
cls.engine = RapidOCR(config_path=ocr_config_path.as_posix())
|
47
|
+
return super().__new__(cls)
|
48
|
+
|
49
|
+
def recognize_text(self, img: Image.Image) -> tuple[tuple[str, Region], ...]:
|
50
|
+
img_gray = img.convert("L")
|
51
|
+
img_hash = hash_image(img_gray)
|
52
|
+
if img_hash in self.img_cache:
|
53
|
+
logger.debug(f"Using cached result for image hash: {img_hash}")
|
54
|
+
return self.img_cache[img_hash]
|
55
|
+
|
56
|
+
assert self.engine is not None, "Engine should be initialized in __new__"
|
57
|
+
result = self.engine(np.array(img_gray))
|
58
|
+
assert isinstance(result, RapidOCROutput), (
|
59
|
+
"Result should be of type RapidOCROutput"
|
60
|
+
)
|
61
|
+
assert result.txts is not None and result.boxes is not None, (
|
62
|
+
"Text recognition failed, txts and boxes should not be None"
|
63
|
+
)
|
64
|
+
|
65
|
+
detections = tuple(
|
66
|
+
(txt, convert_points_to_ltwh(box))
|
67
|
+
for txt, box in zip(result.txts, result.boxes)
|
68
|
+
)
|
69
|
+
self.img_cache[img_hash] = detections
|
70
|
+
return detections
|
@@ -0,0 +1,112 @@
|
|
1
|
+
Global:
|
2
|
+
text_score: 0.5
|
3
|
+
|
4
|
+
use_det: true
|
5
|
+
use_cls: false
|
6
|
+
use_angle_cls: false
|
7
|
+
use_rec: true
|
8
|
+
|
9
|
+
min_height: 30
|
10
|
+
width_height_ratio: 8
|
11
|
+
max_side_len: 2000
|
12
|
+
min_side_len: 30
|
13
|
+
|
14
|
+
return_word_box: false
|
15
|
+
return_single_char_box: false
|
16
|
+
|
17
|
+
font_path: null
|
18
|
+
|
19
|
+
EngineConfig:
|
20
|
+
onnxruntime:
|
21
|
+
intra_op_num_threads: -1
|
22
|
+
inter_op_num_threads: -1
|
23
|
+
enable_cpu_mem_arena: false
|
24
|
+
|
25
|
+
cpu_ep_cfg:
|
26
|
+
arena_extend_strategy: "kSameAsRequested"
|
27
|
+
|
28
|
+
use_cuda: false
|
29
|
+
cuda_ep_cfg:
|
30
|
+
device_id: 0
|
31
|
+
arena_extend_strategy: "kNextPowerOfTwo"
|
32
|
+
cudnn_conv_algo_search: "EXHAUSTIVE"
|
33
|
+
do_copy_in_default_stream: true
|
34
|
+
|
35
|
+
use_dml: false
|
36
|
+
dm_ep_cfg: null
|
37
|
+
|
38
|
+
use_cann: false
|
39
|
+
cann_ep_cfg:
|
40
|
+
device_id: 0
|
41
|
+
arena_extend_strategy: "kNextPowerOfTwo"
|
42
|
+
npu_mem_limit: 21474836480 # 20 * 1024 * 1024 * 1024
|
43
|
+
op_select_impl_mode: "high_performance"
|
44
|
+
optypelist_for_implmode: "Gelu"
|
45
|
+
enable_cann_graph: true
|
46
|
+
|
47
|
+
openvino:
|
48
|
+
inference_num_threads: -1
|
49
|
+
|
50
|
+
paddle:
|
51
|
+
cpu_math_library_num_threads: -1
|
52
|
+
use_cuda: false
|
53
|
+
gpu_id: 0
|
54
|
+
gpu_mem: 500
|
55
|
+
|
56
|
+
torch:
|
57
|
+
use_cuda: false
|
58
|
+
gpu_id: 0
|
59
|
+
|
60
|
+
Det:
|
61
|
+
engine_type: "onnxruntime"
|
62
|
+
lang_type: "en"
|
63
|
+
model_type: "mobile"
|
64
|
+
ocr_version: "PP-OCRv4"
|
65
|
+
|
66
|
+
task_type: "det"
|
67
|
+
|
68
|
+
model_path: null
|
69
|
+
model_dir: null
|
70
|
+
|
71
|
+
limit_side_len: 736
|
72
|
+
limit_type: min
|
73
|
+
std: [ 0.5, 0.5, 0.5 ]
|
74
|
+
mean: [ 0.5, 0.5, 0.5 ]
|
75
|
+
|
76
|
+
thresh: 0.3
|
77
|
+
box_thresh: 0.5
|
78
|
+
max_candidates: 1000
|
79
|
+
unclip_ratio: 1.6
|
80
|
+
use_dilation: true
|
81
|
+
score_mode: fast
|
82
|
+
|
83
|
+
Cls:
|
84
|
+
engine_type: "onnxruntime"
|
85
|
+
lang_type: "ch"
|
86
|
+
model_type: "mobile"
|
87
|
+
ocr_version: "PP-OCRv4"
|
88
|
+
|
89
|
+
task_type: "cls"
|
90
|
+
|
91
|
+
model_path: null
|
92
|
+
model_dir: null
|
93
|
+
|
94
|
+
cls_image_shape: [3, 48, 192]
|
95
|
+
cls_batch_num: 6
|
96
|
+
cls_thresh: 0.9
|
97
|
+
label_list: ["0", "180"]
|
98
|
+
|
99
|
+
Rec:
|
100
|
+
engine_type: "onnxruntime"
|
101
|
+
lang_type: "en"
|
102
|
+
model_type: "mobile"
|
103
|
+
ocr_version: "PP-OCRv4"
|
104
|
+
|
105
|
+
task_type: "rec"
|
106
|
+
|
107
|
+
model_path: null
|
108
|
+
model_dir: null
|
109
|
+
|
110
|
+
rec_keys_path: null
|
111
|
+
rec_img_shape: [3, 48, 320]
|
112
|
+
rec_batch_num: 6
|
pyautoscene/references.py
CHANGED
@@ -1,38 +1,78 @@
|
|
1
1
|
from abc import ABC, abstractmethod
|
2
|
+
from typing import override
|
2
3
|
|
3
4
|
import pyautogui as gui
|
4
|
-
|
5
|
+
|
6
|
+
from .screen import RegionSpec, generate_region_from_spec, locate_on_screen
|
5
7
|
|
6
8
|
|
7
9
|
class ReferenceElement(ABC):
|
8
10
|
"""Base class for reference elements used to identify scenes."""
|
9
11
|
|
10
12
|
@abstractmethod
|
11
|
-
def is_visible(self):
|
13
|
+
def is_visible(self, region: RegionSpec | None = None) -> RegionSpec | None:
|
12
14
|
"""Detect the presence of the reference element."""
|
13
15
|
raise NotImplementedError("Subclasses must implement this method")
|
14
16
|
|
15
17
|
|
16
|
-
class
|
18
|
+
class ImageElement(ReferenceElement):
|
17
19
|
"""Reference element that identifies a scene by an image."""
|
18
20
|
|
19
|
-
def __init__(
|
20
|
-
self
|
21
|
+
def __init__(
|
22
|
+
self,
|
23
|
+
path: str | list[str],
|
24
|
+
confidence: float = 0.999,
|
25
|
+
region: RegionSpec | None = None,
|
26
|
+
):
|
27
|
+
self.path = path
|
28
|
+
self.confidence = confidence
|
29
|
+
self.region = region
|
21
30
|
|
22
|
-
|
31
|
+
@override
|
32
|
+
def is_visible(self, region: RegionSpec | None = None):
|
23
33
|
"""Method to detect the presence of the image in the current screen."""
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
34
|
+
if isinstance(self.path, str):
|
35
|
+
path = [self.path] # Ensure path is a list for consistency
|
36
|
+
else:
|
37
|
+
path = self.path
|
38
|
+
for image_path in path:
|
39
|
+
try:
|
40
|
+
location = locate_on_screen(
|
41
|
+
image_path, region=region or self.region, confidence=self.confidence
|
42
|
+
)
|
43
|
+
return location
|
44
|
+
except gui.ImageNotFoundException:
|
45
|
+
continue
|
28
46
|
|
29
47
|
|
30
|
-
class
|
48
|
+
class TextElement(ReferenceElement):
|
31
49
|
"""Reference element that identifies a scene by text."""
|
32
50
|
|
33
|
-
def __init__(
|
51
|
+
def __init__(
|
52
|
+
self,
|
53
|
+
text: str,
|
54
|
+
region: RegionSpec | None = None,
|
55
|
+
case_sensitive: bool = False,
|
56
|
+
):
|
34
57
|
self.text = text
|
58
|
+
self.region = region
|
59
|
+
self.case_sensitive = case_sensitive
|
60
|
+
if not case_sensitive:
|
61
|
+
self.text = self.text.lower()
|
35
62
|
|
36
|
-
def is_visible(self):
|
63
|
+
def is_visible(self, region: RegionSpec | None = None):
|
37
64
|
"""Method to detect the presence of the text in the current screen."""
|
38
|
-
|
65
|
+
from .ocr import OCR
|
66
|
+
|
67
|
+
ocr = OCR()
|
68
|
+
region = region or self.region
|
69
|
+
for text, detected_region in ocr.recognize_text(
|
70
|
+
gui.screenshot(
|
71
|
+
region=generate_region_from_spec(region).to_box() if region else None
|
72
|
+
)
|
73
|
+
):
|
74
|
+
if not self.case_sensitive:
|
75
|
+
text = text.lower()
|
76
|
+
if text.strip() == self.text.strip():
|
77
|
+
return detected_region
|
78
|
+
return None
|
pyautoscene/scene.py
CHANGED
@@ -2,12 +2,12 @@ from __future__ import annotations
|
|
2
2
|
|
3
3
|
from typing import Callable, TypedDict
|
4
4
|
|
5
|
-
from pyscreeze import Box
|
6
5
|
from statemachine import State
|
7
6
|
|
8
7
|
from pyautoscene.utils import is_valid_variable_name
|
9
8
|
|
10
|
-
from .references import ReferenceElement
|
9
|
+
from .references import ReferenceElement
|
10
|
+
from .screen import Region
|
11
11
|
|
12
12
|
|
13
13
|
class ActionInfo(TypedDict):
|
@@ -51,11 +51,11 @@ class Scene(State):
|
|
51
51
|
"""Get an action by name."""
|
52
52
|
return self.actions.get(action_name)
|
53
53
|
|
54
|
-
def is_on_screen(self, region:
|
54
|
+
def is_on_screen(self, region: Region | None = None) -> bool:
|
55
55
|
"""Check if any reference element is currently on screen."""
|
56
56
|
# TODO: Refactor after text recognition is implemented
|
57
|
-
elements = (elem for elem in self.elements if isinstance(elem, ReferenceImage))
|
58
|
-
return all(elem.is_visible(region) for elem in elements)
|
57
|
+
# elements = (elem for elem in self.elements if isinstance(elem, ReferenceImage))
|
58
|
+
return all(elem.is_visible(region) for elem in self.elements)
|
59
59
|
|
60
60
|
def __repr__(self):
|
61
61
|
return f"Scene({self.name!r}, elements={len(self.elements)})"
|
pyautoscene/screen.py
ADDED
@@ -0,0 +1,79 @@
|
|
1
|
+
from __future__ import annotations
|
2
|
+
|
3
|
+
import re
|
4
|
+
from dataclasses import dataclass
|
5
|
+
|
6
|
+
import numpy as np
|
7
|
+
import pyautogui as gui
|
8
|
+
from PIL import Image
|
9
|
+
from pyscreeze import Box
|
10
|
+
|
11
|
+
axis_pattern = re.compile(r"(?P<d>[xy]):\(?(?P<i>\d+)(?:-(?P<j>\d+))?\)?/(?P<n>\d+)")
|
12
|
+
|
13
|
+
|
14
|
+
@dataclass(frozen=True, slots=True)
|
15
|
+
class Region:
|
16
|
+
left: int
|
17
|
+
top: int
|
18
|
+
width: int
|
19
|
+
height: int
|
20
|
+
|
21
|
+
def to_box(self) -> Box:
|
22
|
+
"""Convert to a pyscreeze Box."""
|
23
|
+
return Box(self.left, self.top, self.width, self.height)
|
24
|
+
|
25
|
+
@classmethod
|
26
|
+
def from_box(cls, box: Box) -> Region:
|
27
|
+
"""Create a Region from a pyscreeze Box."""
|
28
|
+
return cls(left=box.left, top=box.top, width=box.width, height=box.height)
|
29
|
+
|
30
|
+
|
31
|
+
RegionSpec = Region | str
|
32
|
+
|
33
|
+
|
34
|
+
def generate_region_from_spec(
|
35
|
+
spec: RegionSpec, shape: tuple[int, int] | None = None
|
36
|
+
) -> Region:
|
37
|
+
if isinstance(spec, Region):
|
38
|
+
return spec
|
39
|
+
if shape is None:
|
40
|
+
img = np.array(gui.screenshot())
|
41
|
+
shape = (img.shape[0]), (img.shape[1])
|
42
|
+
|
43
|
+
default_region = {"left": 0, "top": 0, "width": shape[1], "height": shape[0]}
|
44
|
+
|
45
|
+
axis_mapping = {"x": ("left", "width", 1), "y": ("top", "height", 0)}
|
46
|
+
for axis, i, j, n in axis_pattern.findall(spec):
|
47
|
+
alignment, size_attr, dim_index = axis_mapping[axis]
|
48
|
+
size = shape[dim_index] // int(n)
|
49
|
+
i, j = int(i), int(j) if j else int(i)
|
50
|
+
default_region.update({
|
51
|
+
alignment: (i - 1) * size,
|
52
|
+
size_attr: (j - i + 1) * size,
|
53
|
+
})
|
54
|
+
|
55
|
+
return Region(**default_region)
|
56
|
+
|
57
|
+
|
58
|
+
def locate_on_screen(
|
59
|
+
reference: Image.Image | str,
|
60
|
+
region: RegionSpec | None = None,
|
61
|
+
confidence: float = 0.999,
|
62
|
+
grayscale: bool = True,
|
63
|
+
limit: int = 1,
|
64
|
+
) -> Region | None:
|
65
|
+
"""Locate a region on the screen."""
|
66
|
+
try:
|
67
|
+
location = gui.locateOnScreen(
|
68
|
+
reference,
|
69
|
+
region=generate_region_from_spec(region).to_box() if region else None,
|
70
|
+
grayscale=grayscale,
|
71
|
+
confidence=confidence,
|
72
|
+
limit=limit,
|
73
|
+
)
|
74
|
+
if location:
|
75
|
+
return Region.from_box(location)
|
76
|
+
except gui.ImageNotFoundException:
|
77
|
+
return None
|
78
|
+
except FileNotFoundError:
|
79
|
+
return None
|
pyautoscene/session.py
CHANGED
@@ -3,13 +3,13 @@ from __future__ import annotations
|
|
3
3
|
from typing import Callable
|
4
4
|
|
5
5
|
import networkx as nx
|
6
|
-
from pyscreeze import Box
|
7
6
|
from statemachine import State, StateMachine
|
8
7
|
from statemachine.factory import StateMachineMetaclass
|
9
8
|
from statemachine.states import States
|
10
9
|
from statemachine.transition_list import TransitionList
|
11
10
|
|
12
11
|
from .scene import Scene
|
12
|
+
from .screen import Region
|
13
13
|
|
14
14
|
|
15
15
|
class SceneRecognitionError(Exception):
|
@@ -45,7 +45,7 @@ def build_dynamic_state_machine(
|
|
45
45
|
return session_sm, transitions, leaf_actions
|
46
46
|
|
47
47
|
|
48
|
-
def get_current_scene(scenes: list[Scene], region:
|
48
|
+
def get_current_scene(scenes: list[Scene], region: Region | None = None) -> Scene:
|
49
49
|
"""Get the current scene from the list of scenes."""
|
50
50
|
current_scenes = [scene for scene in scenes if scene.is_on_screen(region)]
|
51
51
|
if len(current_scenes) == 1:
|
@@ -1,15 +1,14 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: pyautoscene
|
3
|
-
Version: 0.
|
3
|
+
Version: 0.2.0
|
4
4
|
Summary: Advance GUI automation
|
5
5
|
Author-email: pritam-dey3 <pritam.pritamdey.984@gmail.com>
|
6
|
+
License-File: LICENSE
|
6
7
|
Requires-Python: >=3.13
|
7
8
|
Requires-Dist: networkx>=3.5
|
8
|
-
Requires-Dist: onnxruntime>=1.22.0
|
9
9
|
Requires-Dist: pillow>=11.3.0
|
10
10
|
Requires-Dist: pyautogui>=0.9.54
|
11
11
|
Requires-Dist: python-statemachine[diagrams]
|
12
|
-
Requires-Dist: rapidocr>=3.2.0
|
13
12
|
Description-Content-Type: text/markdown
|
14
13
|
|
15
14
|
# PyAutoScene
|
@@ -21,7 +20,8 @@ PyAutoScene is a Python library that provides a declarative approach to GUI auto
|
|
21
20
|
## 🌟 Features
|
22
21
|
|
23
22
|
- **Scene-Based Architecture**: Model your application as a collection of scenes with defined elements and transitions
|
24
|
-
- **Visual Element Detection**: Supports both image-based
|
23
|
+
- **Visual Element Detection**: Supports both image-based and text-based element recognition
|
24
|
+
- **Region Specification**: Flexible region syntax for targeting specific screen areas
|
25
25
|
- **Automatic Navigation**: Intelligent pathfinding between scenes using graph algorithms
|
26
26
|
- **Action Decorators**: Clean, declarative syntax for defining scene actions and transitions
|
27
27
|
|
@@ -39,15 +39,15 @@ Here's how to automate a simple login flow:
|
|
39
39
|
|
40
40
|
```python
|
41
41
|
import pyautogui as gui
|
42
|
-
from pyautoscene import
|
42
|
+
from pyautoscene import ImageElement, TextElement, Scene, Session
|
43
43
|
from pyautoscene.utils import locate_and_click
|
44
44
|
|
45
45
|
# Define scenes
|
46
46
|
login = Scene(
|
47
47
|
"Login",
|
48
48
|
elements=[
|
49
|
-
|
50
|
-
|
49
|
+
TextElement("Welcome to Login"),
|
50
|
+
ImageElement("references/login_button.png"),
|
51
51
|
],
|
52
52
|
initial=True,
|
53
53
|
)
|
@@ -55,8 +55,8 @@ login = Scene(
|
|
55
55
|
dashboard = Scene(
|
56
56
|
"Dashboard",
|
57
57
|
elements=[
|
58
|
-
|
59
|
-
|
58
|
+
TextElement("Dashboard"),
|
59
|
+
ImageElement("references/user_menu.png"),
|
60
60
|
],
|
61
61
|
)
|
62
62
|
|
@@ -89,8 +89,8 @@ A **Scene** represents a distinct state in your application's UI. Each scene con
|
|
89
89
|
scene = Scene(
|
90
90
|
"SceneName",
|
91
91
|
elements=[
|
92
|
-
|
93
|
-
|
92
|
+
ImageElement("path/to/image.png"),
|
93
|
+
TextElement("Expected Text"),
|
94
94
|
],
|
95
95
|
initial=False # Set to True for starting scene
|
96
96
|
)
|
@@ -100,20 +100,33 @@ scene = Scene(
|
|
100
100
|
|
101
101
|
PyAutoScene supports two types of reference elements:
|
102
102
|
|
103
|
-
####
|
103
|
+
#### ImageElement
|
104
104
|
|
105
105
|
Detects scenes using image matching:
|
106
106
|
|
107
107
|
```python
|
108
|
-
|
108
|
+
ImageElement("path/to/reference/image.png")
|
109
109
|
```
|
110
110
|
|
111
|
-
####
|
112
|
-
|
111
|
+
#### TextElement
|
112
|
+
|
113
113
|
Detects scenes using text recognition:
|
114
114
|
|
115
115
|
```python
|
116
|
-
|
116
|
+
TextElement("Expected text on screen")
|
117
|
+
```
|
118
|
+
|
119
|
+
Both elements support region specification for limiting search areas. You can specify regions using a string format like `"x:2/3 y:(1-2)/3"` to easily define screen regions:
|
120
|
+
|
121
|
+
```python
|
122
|
+
# Search for text in the top-left third of the screen
|
123
|
+
TextElement("Login", region="x:1/3 y:1/3")
|
124
|
+
|
125
|
+
# Search in a horizontal band across the middle third of the screen
|
126
|
+
ImageElement("button.png", region="y:2/3")
|
127
|
+
|
128
|
+
# Search in a specific area spanning columns 1-2 out of 3 columns
|
129
|
+
TextElement("Welcome", region="x:(1-2)/3 y:1/3")
|
117
130
|
```
|
118
131
|
|
119
132
|
### Actions and Transitions
|
@@ -194,7 +207,15 @@ This project is licensed under the Apache License 2.0 - see the [LICENSE](LICENS
|
|
194
207
|
|
195
208
|
## 🔮 Roadmap
|
196
209
|
|
197
|
-
- [ ] Text recognition implementation
|
198
210
|
- [ ] Enhanced image matching algorithms
|
211
|
+
- [ ] TemplateScene
|
212
|
+
- [ ] Relation between images
|
199
213
|
- [ ] Multiple session support
|
200
214
|
|
215
|
+
## 🙏 Credits
|
216
|
+
|
217
|
+
PyAutoScene builds on the work of several open-source projects:
|
218
|
+
|
219
|
+
- [PyAutoGUI](https://github.com/asweigart/pyautogui) by Al Sweigart
|
220
|
+
- [python-statemachine](https://github.com/fgmacedo/python-statemachine) by Filipe Macedo
|
221
|
+
- [RapidOCR](https://github.com/RapidAI/RapidOCR) by RapidAI contributors
|
@@ -0,0 +1,13 @@
|
|
1
|
+
pyautoscene/__init__.py,sha256=clSA3hhv4eGTi1C4oN4BKX7i5ILZOy4ABVO0wFUfSXo,167
|
2
|
+
pyautoscene/ocr.py,sha256=obrRlgqJBL19MHF1ZOdPssrj2qjrWpPcJqtuBu1-cII,2238
|
3
|
+
pyautoscene/ocr_config.yaml,sha256=KZcOd05nAhHt0cmUI-lmXhKfx4Q3-f0Yv8_4cqaeNA0,2343
|
4
|
+
pyautoscene/references.py,sha256=i4VdqqiyzkCzGQ6qqJ9zdy6DoNba1wUVpA8l7FAN9lA,2560
|
5
|
+
pyautoscene/scene.py,sha256=QIKSCOhAWdJH0mTrpKhoyfHwBu3GxhcCr0beqYABkjg,2058
|
6
|
+
pyautoscene/screen.py,sha256=6KsdzemGoQASUxfLKXClMWowZJa2YFigsJvgFk2kWp8,2268
|
7
|
+
pyautoscene/session.py,sha256=z21j-DLu-pk7riXKi_OhRSarjqRQAE4qWr1eD9AlAhU,4866
|
8
|
+
pyautoscene/utils.py,sha256=yc6jkaz-X_sUaOpRS9UG42UnFumhMN7648BunRp2PXM,794
|
9
|
+
pyautoscene-0.2.0.dist-info/METADATA,sha256=1LQGQdAH3x_zk4dLwHGcWqQ79mEymp5hHrAhQnWhVp4,5901
|
10
|
+
pyautoscene-0.2.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
11
|
+
pyautoscene-0.2.0.dist-info/entry_points.txt,sha256=6aKjylfDivCRMrJasIIi7ICU4fZR-8HjcOHhRmHpYpQ,49
|
12
|
+
pyautoscene-0.2.0.dist-info/licenses/LICENSE,sha256=HrhfyXIkWY2tGFK11kg7vPCqhgh5DcxleloqdhrpyMY,11558
|
13
|
+
pyautoscene-0.2.0.dist-info/RECORD,,
|
@@ -0,0 +1,201 @@
|
|
1
|
+
Apache License
|
2
|
+
Version 2.0, January 2004
|
3
|
+
http://www.apache.org/licenses/
|
4
|
+
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
6
|
+
|
7
|
+
1. Definitions.
|
8
|
+
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
11
|
+
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
13
|
+
the copyright owner that is granting the License.
|
14
|
+
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
16
|
+
other entities that control, are controlled by, or are under common
|
17
|
+
control with that entity. For the purposes of this definition,
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
19
|
+
direction or management of such entity, whether by contract or
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
22
|
+
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
24
|
+
exercising permissions granted by this License.
|
25
|
+
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
27
|
+
including but not limited to software source code, documentation
|
28
|
+
source, and configuration files.
|
29
|
+
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
31
|
+
transformation or translation of a Source form, including but
|
32
|
+
not limited to compiled object code, generated documentation,
|
33
|
+
and conversions to other media types.
|
34
|
+
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
36
|
+
Object form, made available under the License, as indicated by a
|
37
|
+
copyright notice that is included in or attached to the work
|
38
|
+
(an example is provided in the Appendix below).
|
39
|
+
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
46
|
+
the Work and Derivative Works thereof.
|
47
|
+
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
49
|
+
the original version of the Work and any modifications or additions
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
61
|
+
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
64
|
+
subsequently incorporated within the Work.
|
65
|
+
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
72
|
+
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
78
|
+
where such license applies only to those patent claims licensable
|
79
|
+
by such Contributor that are necessarily infringed by their
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
82
|
+
institute patent litigation against any entity (including a
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
85
|
+
or contributory patent infringement, then any patent licenses
|
86
|
+
granted to You under this License for that Work shall terminate
|
87
|
+
as of the date such litigation is filed.
|
88
|
+
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
91
|
+
modifications, and in Source or Object form, provided that You
|
92
|
+
meet the following conditions:
|
93
|
+
|
94
|
+
(a) You must give any other recipients of the Work or
|
95
|
+
Derivative Works a copy of this License; and
|
96
|
+
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
98
|
+
stating that You changed the files; and
|
99
|
+
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
102
|
+
attribution notices from the Source form of the Work,
|
103
|
+
excluding those notices that do not pertain to any part of
|
104
|
+
the Derivative Works; and
|
105
|
+
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
108
|
+
include a readable copy of the attribution notices contained
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
111
|
+
of the following places: within a NOTICE text file distributed
|
112
|
+
as part of the Derivative Works; within the Source form or
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
114
|
+
within a display generated by the Derivative Works, if and
|
115
|
+
wherever such third-party notices normally appear. The contents
|
116
|
+
of the NOTICE file are for informational purposes only and
|
117
|
+
do not modify the License. You may add Your own attribution
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
120
|
+
that such additional attribution notices cannot be construed
|
121
|
+
as modifying the License.
|
122
|
+
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
124
|
+
may provide additional or different license terms and conditions
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
128
|
+
the conditions stated in this License.
|
129
|
+
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
133
|
+
this License, without any additional terms or conditions.
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
135
|
+
the terms of any separate license agreement you may have executed
|
136
|
+
with Licensor regarding such Contributions.
|
137
|
+
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
140
|
+
except as required for reasonable and customary use in describing the
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
142
|
+
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
152
|
+
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
158
|
+
incidental, or consequential damages of any character arising as a
|
159
|
+
result of this License or out of the use or inability to use the
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
162
|
+
other commercial damages or losses), even if such Contributor
|
163
|
+
has been advised of the possibility of such damages.
|
164
|
+
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
168
|
+
or other liability obligations and/or rights consistent with this
|
169
|
+
License. However, in accepting such obligations, You may act only
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
174
|
+
of your accepting any such warranty or additional liability.
|
175
|
+
|
176
|
+
END OF TERMS AND CONDITIONS
|
177
|
+
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
179
|
+
|
180
|
+
To apply the Apache License to your work, attach the following
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
182
|
+
replaced with your own identifying information. (Don't include
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
184
|
+
comment syntax for the file format. We also recommend that a
|
185
|
+
file or class name and description of purpose be included on the
|
186
|
+
same "printed page" as the copyright notice for easier
|
187
|
+
identification within third-party archives.
|
188
|
+
|
189
|
+
Copyright [yyyy] [name of copyright owner]
|
190
|
+
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
192
|
+
you may not use this file except in compliance with the License.
|
193
|
+
You may obtain a copy of the License at
|
194
|
+
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
196
|
+
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
200
|
+
See the License for the specific language governing permissions and
|
201
|
+
limitations under the License.
|
@@ -1,9 +0,0 @@
|
|
1
|
-
pyautoscene/__init__.py,sha256=4ppGaF-TV-r874c4Q679n6gkSflveKTFu_u-eCpG5yU,175
|
2
|
-
pyautoscene/references.py,sha256=wAKZIIrZX2gXnuHsXb-eliF6xk-taVG_ZOvWUj8QLV0,1224
|
3
|
-
pyautoscene/scene.py,sha256=Koc2hTQQvNOVRfoYvPwtEYNosb1aRuhpo-3KKOuoWfw,2063
|
4
|
-
pyautoscene/session.py,sha256=D-YKH8HJNjpqxqV9HdxZA-cbsbYf8_iMR59Tl3IRph4,4862
|
5
|
-
pyautoscene/utils.py,sha256=yc6jkaz-X_sUaOpRS9UG42UnFumhMN7648BunRp2PXM,794
|
6
|
-
pyautoscene-0.1.0.dist-info/METADATA,sha256=gHbgYywzt8pw1_uSU5YFiKK9EhRL6b73k7bH4uZnCnk,5080
|
7
|
-
pyautoscene-0.1.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
8
|
-
pyautoscene-0.1.0.dist-info/entry_points.txt,sha256=6aKjylfDivCRMrJasIIi7ICU4fZR-8HjcOHhRmHpYpQ,49
|
9
|
-
pyautoscene-0.1.0.dist-info/RECORD,,
|
File without changes
|
File without changes
|