tzafon 2.4.4__tar.gz
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.
- tzafon-2.4.4/.gitignore +15 -0
- tzafon-2.4.4/.release-please-manifest.json +3 -0
- tzafon-2.4.4/CHANGELOG.md +198 -0
- tzafon-2.4.4/CONTRIBUTING.md +128 -0
- tzafon-2.4.4/LICENSE +7 -0
- tzafon-2.4.4/PKG-INFO +229 -0
- tzafon-2.4.4/README.md +194 -0
- tzafon-2.4.4/SECURITY.md +27 -0
- tzafon-2.4.4/api.md +38 -0
- tzafon-2.4.4/bin/check-release-environment +21 -0
- tzafon-2.4.4/bin/publish-pypi +6 -0
- tzafon-2.4.4/examples/.keep +4 -0
- tzafon-2.4.4/noxfile.py +9 -0
- tzafon-2.4.4/pyproject.toml +267 -0
- tzafon-2.4.4/release-please-config.json +66 -0
- tzafon-2.4.4/requirements-dev.lock +137 -0
- tzafon-2.4.4/requirements.lock +75 -0
- tzafon-2.4.4/src/computer/lib/.keep +4 -0
- tzafon-2.4.4/src/tzafon/__init__.py +112 -0
- tzafon-2.4.4/src/tzafon/_base_client.py +1995 -0
- tzafon-2.4.4/src/tzafon/_client.py +441 -0
- tzafon-2.4.4/src/tzafon/_compat.py +219 -0
- tzafon-2.4.4/src/tzafon/_constants.py +14 -0
- tzafon-2.4.4/src/tzafon/_exceptions.py +108 -0
- tzafon-2.4.4/src/tzafon/_files.py +123 -0
- tzafon-2.4.4/src/tzafon/_models.py +835 -0
- tzafon-2.4.4/src/tzafon/_qs.py +150 -0
- tzafon-2.4.4/src/tzafon/_resource.py +43 -0
- tzafon-2.4.4/src/tzafon/_response.py +830 -0
- tzafon-2.4.4/src/tzafon/_streaming.py +331 -0
- tzafon-2.4.4/src/tzafon/_types.py +260 -0
- tzafon-2.4.4/src/tzafon/_utils/__init__.py +64 -0
- tzafon-2.4.4/src/tzafon/_utils/_compat.py +45 -0
- tzafon-2.4.4/src/tzafon/_utils/_datetime_parse.py +136 -0
- tzafon-2.4.4/src/tzafon/_utils/_logs.py +25 -0
- tzafon-2.4.4/src/tzafon/_utils/_proxy.py +65 -0
- tzafon-2.4.4/src/tzafon/_utils/_reflection.py +42 -0
- tzafon-2.4.4/src/tzafon/_utils/_resources_proxy.py +24 -0
- tzafon-2.4.4/src/tzafon/_utils/_streams.py +12 -0
- tzafon-2.4.4/src/tzafon/_utils/_sync.py +86 -0
- tzafon-2.4.4/src/tzafon/_utils/_transform.py +457 -0
- tzafon-2.4.4/src/tzafon/_utils/_typing.py +156 -0
- tzafon-2.4.4/src/tzafon/_utils/_utils.py +421 -0
- tzafon-2.4.4/src/tzafon/_version.py +4 -0
- tzafon-2.4.4/src/tzafon/lib/.keep +4 -0
- tzafon-2.4.4/src/tzafon/lib/__init__.py +21 -0
- tzafon-2.4.4/src/tzafon/lib/result_types.py +77 -0
- tzafon-2.4.4/src/tzafon/lib/wrapper.py +326 -0
- tzafon-2.4.4/src/tzafon/py.typed +0 -0
- tzafon-2.4.4/src/tzafon/resources/__init__.py +19 -0
- tzafon-2.4.4/src/tzafon/resources/computers.py +2051 -0
- tzafon-2.4.4/src/tzafon/types/__init__.py +24 -0
- tzafon-2.4.4/src/tzafon/types/action_result.py +19 -0
- tzafon-2.4.4/src/tzafon/types/computer_capture_screenshot_params.py +11 -0
- tzafon-2.4.4/src/tzafon/types/computer_click_params.py +13 -0
- tzafon-2.4.4/src/tzafon/types/computer_create_params.py +36 -0
- tzafon-2.4.4/src/tzafon/types/computer_debug_params.py +15 -0
- tzafon-2.4.4/src/tzafon/types/computer_double_click_params.py +13 -0
- tzafon-2.4.4/src/tzafon/types/computer_drag_params.py +17 -0
- tzafon-2.4.4/src/tzafon/types/computer_execute_action_params.py +72 -0
- tzafon-2.4.4/src/tzafon/types/computer_execute_batch_params.py +73 -0
- tzafon-2.4.4/src/tzafon/types/computer_execute_batch_response.py +8 -0
- tzafon-2.4.4/src/tzafon/types/computer_get_html_params.py +11 -0
- tzafon-2.4.4/src/tzafon/types/computer_keep_alive_response.py +8 -0
- tzafon-2.4.4/src/tzafon/types/computer_list_response.py +10 -0
- tzafon-2.4.4/src/tzafon/types/computer_navigate_params.py +11 -0
- tzafon-2.4.4/src/tzafon/types/computer_press_hotkey_params.py +13 -0
- tzafon-2.4.4/src/tzafon/types/computer_response.py +19 -0
- tzafon-2.4.4/src/tzafon/types/computer_right_click_params.py +13 -0
- tzafon-2.4.4/src/tzafon/types/computer_scroll_viewport_params.py +17 -0
- tzafon-2.4.4/src/tzafon/types/computer_set_viewport_params.py +15 -0
- tzafon-2.4.4/src/tzafon/types/computer_type_text_params.py +11 -0
- tzafon-2.4.4/src/tzafonComputer/lib/.keep +4 -0
- tzafon-2.4.4/tests/__init__.py +1 -0
- tzafon-2.4.4/tests/api_resources/__init__.py +1 -0
- tzafon-2.4.4/tests/api_resources/test_computers.py +2238 -0
- tzafon-2.4.4/tests/conftest.py +84 -0
- tzafon-2.4.4/tests/sample_file.txt +1 -0
- tzafon-2.4.4/tests/test_client.py +1717 -0
- tzafon-2.4.4/tests/test_deepcopy.py +58 -0
- tzafon-2.4.4/tests/test_extract_files.py +64 -0
- tzafon-2.4.4/tests/test_files.py +51 -0
- tzafon-2.4.4/tests/test_models.py +963 -0
- tzafon-2.4.4/tests/test_qs.py +78 -0
- tzafon-2.4.4/tests/test_required_args.py +111 -0
- tzafon-2.4.4/tests/test_response.py +277 -0
- tzafon-2.4.4/tests/test_streaming.py +248 -0
- tzafon-2.4.4/tests/test_transform.py +460 -0
- tzafon-2.4.4/tests/test_utils/test_datetime_parse.py +110 -0
- tzafon-2.4.4/tests/test_utils/test_proxy.py +34 -0
- tzafon-2.4.4/tests/test_utils/test_typing.py +73 -0
- tzafon-2.4.4/tests/utils.py +167 -0
tzafon-2.4.4/.gitignore
ADDED
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## 2.4.4 (2025-11-04)
|
|
4
|
+
|
|
5
|
+
Full Changelog: [v2.4.3...v2.4.4](https://github.com/tzafon/computer-python/compare/v2.4.3...v2.4.4)
|
|
6
|
+
|
|
7
|
+
## 2.4.3 (2025-11-04)
|
|
8
|
+
|
|
9
|
+
Full Changelog: [v2.4.2...v2.4.3](https://github.com/tzafon/computer-python/compare/v2.4.2...v2.4.3)
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* modifier list hotkeys ([f92f449](https://github.com/tzafon/computer-python/commit/f92f4493efa5111ffca00f28dc3a45d9bc285230))
|
|
14
|
+
|
|
15
|
+
## 2.4.2 (2025-11-04)
|
|
16
|
+
|
|
17
|
+
Full Changelog: [v2.4.1...v2.4.2](https://github.com/tzafon/computer-python/compare/v2.4.1...v2.4.2)
|
|
18
|
+
|
|
19
|
+
## 2.4.1 (2025-11-04)
|
|
20
|
+
|
|
21
|
+
Full Changelog: [v2.4.0...v2.4.1](https://github.com/tzafon/computer-python/compare/v2.4.0...v2.4.1)
|
|
22
|
+
|
|
23
|
+
### Chores
|
|
24
|
+
|
|
25
|
+
* **internal:** grammar fix (it's -> its) ([88dceea](https://github.com/tzafon/computer-python/commit/88dceead54766c6ebe6366c96b702b6c699d5d28))
|
|
26
|
+
|
|
27
|
+
## 2.4.0 (2025-11-03)
|
|
28
|
+
|
|
29
|
+
Full Changelog: [v2.3.3...v2.4.0](https://github.com/tzafon/computer-python/compare/v2.3.3...v2.4.0)
|
|
30
|
+
|
|
31
|
+
### Features
|
|
32
|
+
|
|
33
|
+
* add wait ([4a7a963](https://github.com/tzafon/computer-python/commit/4a7a9631ee0b4a1ca33c813faded83227f95471a))
|
|
34
|
+
|
|
35
|
+
## 2.3.3 (2025-11-03)
|
|
36
|
+
|
|
37
|
+
Full Changelog: [v2.3.2...v2.3.3](https://github.com/tzafon/computer-python/compare/v2.3.2...v2.3.3)
|
|
38
|
+
|
|
39
|
+
## 2.3.2 (2025-11-03)
|
|
40
|
+
|
|
41
|
+
Full Changelog: [v2.3.1...v2.3.2](https://github.com/tzafon/computer-python/compare/v2.3.1...v2.3.2)
|
|
42
|
+
|
|
43
|
+
## 2.3.1 (2025-11-03)
|
|
44
|
+
|
|
45
|
+
Full Changelog: [v2.3.0...v2.3.1](https://github.com/tzafon/computer-python/compare/v2.3.0...v2.3.1)
|
|
46
|
+
|
|
47
|
+
## 2.3.0 (2025-11-03)
|
|
48
|
+
|
|
49
|
+
Full Changelog: [v2.2.0...v2.3.0](https://github.com/tzafon/computer-python/compare/v2.2.0...v2.3.0)
|
|
50
|
+
|
|
51
|
+
### Features
|
|
52
|
+
|
|
53
|
+
* **api:** manual updates ([4247614](https://github.com/tzafon/computer-python/commit/4247614c9c5d391d84c80b7ad36dbc89002f1ec8))
|
|
54
|
+
|
|
55
|
+
## 2.2.0 (2025-11-03)
|
|
56
|
+
|
|
57
|
+
Full Changelog: [v2.1.0...v2.2.0](https://github.com/tzafon/computer-python/compare/v2.1.0...v2.2.0)
|
|
58
|
+
|
|
59
|
+
### Features
|
|
60
|
+
|
|
61
|
+
* **api:** api update ([4950128](https://github.com/tzafon/computer-python/commit/4950128991e4e714562709df3d84eb0f1270677b))
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
### Chores
|
|
65
|
+
|
|
66
|
+
* **internal/tests:** avoid race condition with implicit client cleanup ([b2a3169](https://github.com/tzafon/computer-python/commit/b2a3169289c6e5117cd42973594618e232e7eb1d))
|
|
67
|
+
* remove custom code ([fa3ccd4](https://github.com/tzafon/computer-python/commit/fa3ccd4b257623a59e61db225e65e0ee415b3517))
|
|
68
|
+
|
|
69
|
+
## 2.1.0 (2025-10-30)
|
|
70
|
+
|
|
71
|
+
Full Changelog: [v2.0.1...v2.1.0](https://github.com/tzafon/computer-python/compare/v2.0.1...v2.1.0)
|
|
72
|
+
|
|
73
|
+
### Features
|
|
74
|
+
|
|
75
|
+
* **api:** api update ([2a38a7f](https://github.com/tzafon/computer-python/commit/2a38a7f2bb027dd6cd627df075d0c8c4399e615d))
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
### Bug Fixes
|
|
79
|
+
|
|
80
|
+
* **client:** close streams without requiring full consumption ([24a5a11](https://github.com/tzafon/computer-python/commit/24a5a114bcb3d3d4ed0c0b5df158e09c99d78a79))
|
|
81
|
+
|
|
82
|
+
## 2.0.1 (2025-10-21)
|
|
83
|
+
|
|
84
|
+
Full Changelog: [v2.0.0...v2.0.1](https://github.com/tzafon/computer-python/compare/v2.0.0...v2.0.1)
|
|
85
|
+
|
|
86
|
+
## 2.0.0 (2025-10-20)
|
|
87
|
+
|
|
88
|
+
Full Changelog: [v1.4.0...v2.0.0](https://github.com/tzafon/computer-python/compare/v1.4.0...v2.0.0)
|
|
89
|
+
|
|
90
|
+
### Features
|
|
91
|
+
|
|
92
|
+
* **api:** manual updates ([29bf74f](https://github.com/tzafon/computer-python/commit/29bf74fecae0fe2aaa70a9f6f5f7ca64ba5ddbff))
|
|
93
|
+
|
|
94
|
+
## 1.4.0 (2025-10-20)
|
|
95
|
+
|
|
96
|
+
Full Changelog: [v1.3.2...v1.4.0](https://github.com/atulgavandetzafon/computer-python/compare/v1.3.2...v1.4.0)
|
|
97
|
+
|
|
98
|
+
### Features
|
|
99
|
+
|
|
100
|
+
* **api:** manual updates ([6405afc](https://github.com/atulgavandetzafon/computer-python/commit/6405afc6031ccdc2e65dbd935d54c340c148a675))
|
|
101
|
+
* renamed api key ([6800a00](https://github.com/atulgavandetzafon/computer-python/commit/6800a0019d321a9bc121745b1b3f9697b52ac565))
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
### Chores
|
|
105
|
+
|
|
106
|
+
* bump `httpx-aiohttp` version to 0.1.9 ([f5e4b7e](https://github.com/atulgavandetzafon/computer-python/commit/f5e4b7ed3a9a62190715a3e426e0c9cd430ad7d7))
|
|
107
|
+
* **internal:** detect missing future annotations with ruff ([3c69485](https://github.com/atulgavandetzafon/computer-python/commit/3c69485eb903332d717f99730319c50f9a6a5776))
|
|
108
|
+
|
|
109
|
+
## 1.3.2 (2025-10-08)
|
|
110
|
+
|
|
111
|
+
Full Changelog: [v1.3.1...v1.3.2](https://github.com/atulgavandetzafon/computer-python/compare/v1.3.1...v1.3.2)
|
|
112
|
+
|
|
113
|
+
### Chores
|
|
114
|
+
|
|
115
|
+
* update SDK settings ([05f237e](https://github.com/atulgavandetzafon/computer-python/commit/05f237ee8b8b72f28301dda597201e051f1b7ef4))
|
|
116
|
+
* update SDK settings ([89b4df6](https://github.com/atulgavandetzafon/computer-python/commit/89b4df64ee207a368dfa80e9ae47a9255da4d545))
|
|
117
|
+
|
|
118
|
+
## 1.3.1 (2025-10-08)
|
|
119
|
+
|
|
120
|
+
Full Changelog: [v1.3.0...v1.3.1](https://github.com/atulgavandetzafon/computer-python/compare/v1.3.0...v1.3.1)
|
|
121
|
+
|
|
122
|
+
## 1.3.0 (2025-10-08)
|
|
123
|
+
|
|
124
|
+
Full Changelog: [v1.2.0...v1.3.0](https://github.com/atulgavandetzafon/computer-python/compare/v1.2.0...v1.3.0)
|
|
125
|
+
|
|
126
|
+
### Features
|
|
127
|
+
|
|
128
|
+
* **api:** manual updates ([92a3ec3](https://github.com/atulgavandetzafon/computer-python/commit/92a3ec3c358004e432973fedd6844add8bcb1c7d))
|
|
129
|
+
|
|
130
|
+
## 1.2.0 (2025-10-08)
|
|
131
|
+
|
|
132
|
+
Full Changelog: [v1.1.4...v1.2.0](https://github.com/atulgavandetzafon/computer-python/compare/v1.1.4...v1.2.0)
|
|
133
|
+
|
|
134
|
+
### Features
|
|
135
|
+
|
|
136
|
+
* **api:** manual updates ([8ce5b6b](https://github.com/atulgavandetzafon/computer-python/commit/8ce5b6bc92fffc1baf956972489ceefbf987be3b))
|
|
137
|
+
* **api:** manual updates ([8fa5045](https://github.com/atulgavandetzafon/computer-python/commit/8fa5045b6bfbf00a3d44833100d36b58d27a83e3))
|
|
138
|
+
* **api:** manual updates ([3dc796f](https://github.com/atulgavandetzafon/computer-python/commit/3dc796fb27186307f81f6e3ad93e6715a707604d))
|
|
139
|
+
* **api:** manual updates ([ff7ae66](https://github.com/atulgavandetzafon/computer-python/commit/ff7ae66be8c4d9c69b52f803b23a0456aebe3c1e))
|
|
140
|
+
* **api:** manual updates ([3492063](https://github.com/atulgavandetzafon/computer-python/commit/3492063eeb600e5c42585ebc8805b50cc0ffe9c0))
|
|
141
|
+
* **api:** manual updates ([a68cfdb](https://github.com/atulgavandetzafon/computer-python/commit/a68cfdb2689829e82063eb672e1736e9f66bd81e))
|
|
142
|
+
* **api:** manual updates ([0e7ee2c](https://github.com/atulgavandetzafon/computer-python/commit/0e7ee2ca2568511b495a154a6b802dd5c4b42908))
|
|
143
|
+
|
|
144
|
+
## 1.1.4 (2025-10-08)
|
|
145
|
+
|
|
146
|
+
Full Changelog: [v1.1.3...v1.1.4](https://github.com/atulgavandetzafon/computer-python/compare/v1.1.3...v1.1.4)
|
|
147
|
+
|
|
148
|
+
## 1.1.3 (2025-10-08)
|
|
149
|
+
|
|
150
|
+
Full Changelog: [v1.1.2...v1.1.3](https://github.com/atulgavandetzafon/computer-python/compare/v1.1.2...v1.1.3)
|
|
151
|
+
|
|
152
|
+
## 1.1.2 (2025-10-08)
|
|
153
|
+
|
|
154
|
+
Full Changelog: [v1.1.1...v1.1.2](https://github.com/atulgavandetzafon/computer-python/compare/v1.1.1...v1.1.2)
|
|
155
|
+
|
|
156
|
+
## 1.1.1 (2025-10-08)
|
|
157
|
+
|
|
158
|
+
Full Changelog: [v1.1.0...v1.1.1](https://github.com/atulgavandetzafon/computer-python/compare/v1.1.0...v1.1.1)
|
|
159
|
+
|
|
160
|
+
## 1.1.0 (2025-10-07)
|
|
161
|
+
|
|
162
|
+
Full Changelog: [v1.0.1...v1.1.0](https://github.com/atulgavandetzafon/computer-python/compare/v1.0.1...v1.1.0)
|
|
163
|
+
|
|
164
|
+
### Features
|
|
165
|
+
|
|
166
|
+
* **api:** manual updates ([aaf8e53](https://github.com/atulgavandetzafon/computer-python/commit/aaf8e534415ea6bc8420f2ed8e3b854011a7bf71))
|
|
167
|
+
* **api:** manual updates ([833115e](https://github.com/atulgavandetzafon/computer-python/commit/833115e5e6814f6347de3e0521faceb4bf9e15e8))
|
|
168
|
+
|
|
169
|
+
|
|
170
|
+
### Chores
|
|
171
|
+
|
|
172
|
+
* update SDK settings ([0b62c4b](https://github.com/atulgavandetzafon/computer-python/commit/0b62c4b04323dabf192fe31e11f45ea94f366411))
|
|
173
|
+
|
|
174
|
+
## 1.0.1 (2025-10-07)
|
|
175
|
+
|
|
176
|
+
Full Changelog: [v0.0.1...v1.0.1](https://github.com/atulgavandetzafon/computer-python/compare/v0.0.1...v1.0.1)
|
|
177
|
+
|
|
178
|
+
### Features
|
|
179
|
+
|
|
180
|
+
* **api:** added python ([7bc6a73](https://github.com/atulgavandetzafon/computer-python/commit/7bc6a73f549bb57bb176de454d395fd692159a0e))
|
|
181
|
+
* **api:** manual updates ([57e4841](https://github.com/atulgavandetzafon/computer-python/commit/57e4841180a11f953e1d8db5e3c1ea7eebbb1d3e))
|
|
182
|
+
* **api:** manual updates ([a23814e](https://github.com/atulgavandetzafon/computer-python/commit/a23814e85afaa64e2a429b2bcb6507b0accb46bc))
|
|
183
|
+
* **api:** Updated to bearer auth ([c95903e](https://github.com/atulgavandetzafon/computer-python/commit/c95903e3795de2823b6266f914647dd55dc4eeba))
|
|
184
|
+
* **api:** v2 api ([db7fdb5](https://github.com/atulgavandetzafon/computer-python/commit/db7fdb5cbcb3ed5f38c2fcebe824573172c223d1))
|
|
185
|
+
* async ([38d796c](https://github.com/atulgavandetzafon/computer-python/commit/38d796c6538fad278abf122887a57a379c5a532b))
|
|
186
|
+
* lets test functionality ([3d5f515](https://github.com/atulgavandetzafon/computer-python/commit/3d5f515098e71964a431849a37c88a7a017424d2))
|
|
187
|
+
* wrapper test1 ([e329ec1](https://github.com/atulgavandetzafon/computer-python/commit/e329ec12ae711d64cad28e04a74bd7c1283669ce))
|
|
188
|
+
|
|
189
|
+
|
|
190
|
+
### Bug Fixes
|
|
191
|
+
|
|
192
|
+
* removed old async ([1b5c5cd](https://github.com/atulgavandetzafon/computer-python/commit/1b5c5cdf4a7c80089e8ca67e13540bdae898ac98))
|
|
193
|
+
|
|
194
|
+
|
|
195
|
+
### Chores
|
|
196
|
+
|
|
197
|
+
* update SDK settings ([a5da45a](https://github.com/atulgavandetzafon/computer-python/commit/a5da45a676c091d3d02fde9352d98d458e4dfe7f))
|
|
198
|
+
* update SDK settings ([3e68f6d](https://github.com/atulgavandetzafon/computer-python/commit/3e68f6db27fae3f75f411d76e15a6df07d22fa2b))
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
## Setting up the environment
|
|
2
|
+
|
|
3
|
+
### With Rye
|
|
4
|
+
|
|
5
|
+
We use [Rye](https://rye.astral.sh/) to manage dependencies because it will automatically provision a Python environment with the expected Python version. To set it up, run:
|
|
6
|
+
|
|
7
|
+
```sh
|
|
8
|
+
$ ./scripts/bootstrap
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
Or [install Rye manually](https://rye.astral.sh/guide/installation/) and run:
|
|
12
|
+
|
|
13
|
+
```sh
|
|
14
|
+
$ rye sync --all-features
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
You can then run scripts using `rye run python script.py` or by activating the virtual environment:
|
|
18
|
+
|
|
19
|
+
```sh
|
|
20
|
+
# Activate the virtual environment - https://docs.python.org/3/library/venv.html#how-venvs-work
|
|
21
|
+
$ source .venv/bin/activate
|
|
22
|
+
|
|
23
|
+
# now you can omit the `rye run` prefix
|
|
24
|
+
$ python script.py
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
### Without Rye
|
|
28
|
+
|
|
29
|
+
Alternatively if you don't want to install `Rye`, you can stick with the standard `pip` setup by ensuring you have the Python version specified in `.python-version`, create a virtual environment however you desire and then install dependencies using this command:
|
|
30
|
+
|
|
31
|
+
```sh
|
|
32
|
+
$ pip install -r requirements-dev.lock
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
## Modifying/Adding code
|
|
36
|
+
|
|
37
|
+
Most of the SDK is generated code. Modifications to code will be persisted between generations, but may
|
|
38
|
+
result in merge conflicts between manual patches and changes from the generator. The generator will never
|
|
39
|
+
modify the contents of the `src/tzafon/lib/` and `examples/` directories.
|
|
40
|
+
|
|
41
|
+
## Adding and running examples
|
|
42
|
+
|
|
43
|
+
All files in the `examples/` directory are not modified by the generator and can be freely edited or added to.
|
|
44
|
+
|
|
45
|
+
```py
|
|
46
|
+
# add an example to examples/<your-example>.py
|
|
47
|
+
|
|
48
|
+
#!/usr/bin/env -S rye run python
|
|
49
|
+
…
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
```sh
|
|
53
|
+
$ chmod +x examples/<your-example>.py
|
|
54
|
+
# run the example against your api
|
|
55
|
+
$ ./examples/<your-example>.py
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
## Using the repository from source
|
|
59
|
+
|
|
60
|
+
If you’d like to use the repository from source, you can either install from git or link to a cloned repository:
|
|
61
|
+
|
|
62
|
+
To install via git:
|
|
63
|
+
|
|
64
|
+
```sh
|
|
65
|
+
$ pip install git+ssh://git@github.com/tzafon/computer-python.git
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
Alternatively, you can build from source and install the wheel file:
|
|
69
|
+
|
|
70
|
+
Building this package will create two files in the `dist/` directory, a `.tar.gz` containing the source files and a `.whl` that can be used to install the package efficiently.
|
|
71
|
+
|
|
72
|
+
To create a distributable version of the library, all you have to do is run this command:
|
|
73
|
+
|
|
74
|
+
```sh
|
|
75
|
+
$ rye build
|
|
76
|
+
# or
|
|
77
|
+
$ python -m build
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
Then to install:
|
|
81
|
+
|
|
82
|
+
```sh
|
|
83
|
+
$ pip install ./path-to-wheel-file.whl
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
## Running tests
|
|
87
|
+
|
|
88
|
+
Most tests require you to [set up a mock server](https://github.com/stoplightio/prism) against the OpenAPI spec to run the tests.
|
|
89
|
+
|
|
90
|
+
```sh
|
|
91
|
+
# you will need npm installed
|
|
92
|
+
$ npx prism mock path/to/your/openapi.yml
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
```sh
|
|
96
|
+
$ ./scripts/test
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
## Linting and formatting
|
|
100
|
+
|
|
101
|
+
This repository uses [ruff](https://github.com/astral-sh/ruff) and
|
|
102
|
+
[black](https://github.com/psf/black) to format the code in the repository.
|
|
103
|
+
|
|
104
|
+
To lint:
|
|
105
|
+
|
|
106
|
+
```sh
|
|
107
|
+
$ ./scripts/lint
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
To format and fix all ruff issues automatically:
|
|
111
|
+
|
|
112
|
+
```sh
|
|
113
|
+
$ ./scripts/format
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
## Publishing and releases
|
|
117
|
+
|
|
118
|
+
Changes made to this repository via the automated release PR pipeline should publish to PyPI automatically. If
|
|
119
|
+
the changes aren't made through the automated pipeline, you may want to make releases manually.
|
|
120
|
+
|
|
121
|
+
### Publish with a GitHub workflow
|
|
122
|
+
|
|
123
|
+
You can release to package managers by using [the `Publish PyPI` GitHub action](https://www.github.com/tzafon/computer-python/actions/workflows/publish-pypi.yml). This requires a setup organization or repository secret to be set up.
|
|
124
|
+
|
|
125
|
+
### Publish manually
|
|
126
|
+
|
|
127
|
+
If you need to manually release a package, you can run the `bin/publish-pypi` script with a `PYPI_TOKEN` set on
|
|
128
|
+
the environment.
|
tzafon-2.4.4/LICENSE
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
Copyright 2025 computer
|
|
2
|
+
|
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
4
|
+
|
|
5
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
6
|
+
|
|
7
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
tzafon-2.4.4/PKG-INFO
ADDED
|
@@ -0,0 +1,229 @@
|
|
|
1
|
+
Metadata-Version: 2.3
|
|
2
|
+
Name: tzafon
|
|
3
|
+
Version: 2.4.4
|
|
4
|
+
Summary: The official Python library for the computer API
|
|
5
|
+
Project-URL: Homepage, https://github.com/tzafon/computer-python
|
|
6
|
+
Project-URL: Repository, https://github.com/tzafon/computer-python
|
|
7
|
+
Author-email: Computer <atul.gavande@tzafon.ai>
|
|
8
|
+
License: MIT
|
|
9
|
+
Classifier: Intended Audience :: Developers
|
|
10
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
11
|
+
Classifier: Operating System :: MacOS
|
|
12
|
+
Classifier: Operating System :: Microsoft :: Windows
|
|
13
|
+
Classifier: Operating System :: OS Independent
|
|
14
|
+
Classifier: Operating System :: POSIX
|
|
15
|
+
Classifier: Operating System :: POSIX :: Linux
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
22
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
23
|
+
Classifier: Typing :: Typed
|
|
24
|
+
Requires-Python: >=3.8
|
|
25
|
+
Requires-Dist: anyio<5,>=3.5.0
|
|
26
|
+
Requires-Dist: distro<2,>=1.7.0
|
|
27
|
+
Requires-Dist: httpx<1,>=0.23.0
|
|
28
|
+
Requires-Dist: pydantic<3,>=1.9.0
|
|
29
|
+
Requires-Dist: sniffio
|
|
30
|
+
Requires-Dist: typing-extensions<5,>=4.10
|
|
31
|
+
Provides-Extra: aiohttp
|
|
32
|
+
Requires-Dist: aiohttp; extra == 'aiohttp'
|
|
33
|
+
Requires-Dist: httpx-aiohttp>=0.1.9; extra == 'aiohttp'
|
|
34
|
+
Description-Content-Type: text/markdown
|
|
35
|
+
|
|
36
|
+
# Tzafon Python SDK
|
|
37
|
+
|
|
38
|
+
[](https://pypi.org/project/tzafon/)
|
|
39
|
+
|
|
40
|
+
Remote browser and desktop automation. Control browsers and desktops programmatically through a simple Python API.
|
|
41
|
+
|
|
42
|
+
## Installation
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
pip install tzafon
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
## Quick Start
|
|
49
|
+
|
|
50
|
+
```python
|
|
51
|
+
from tzafon import Computer
|
|
52
|
+
|
|
53
|
+
client = Computer() # Reads TZAFON_API_KEY from environment
|
|
54
|
+
|
|
55
|
+
# Create and control a browser instance
|
|
56
|
+
with client.create(kind="browser") as computer:
|
|
57
|
+
computer.navigate("https://wikipedia.com")
|
|
58
|
+
|
|
59
|
+
result = computer.screenshot()
|
|
60
|
+
url = computer.get_screenshot_url(result)
|
|
61
|
+
print(f"Screenshot: {url}")
|
|
62
|
+
|
|
63
|
+
computer.click(100, 200)
|
|
64
|
+
computer.type("Hello, world!")
|
|
65
|
+
|
|
66
|
+
# Automatically terminates when exiting context
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
Set your API key:
|
|
70
|
+
```bash
|
|
71
|
+
export TZAFON_API_KEY="your-api-key"
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
Or use a `.env` file with [python-dotenv](https://pypi.org/project/python-dotenv/).
|
|
75
|
+
|
|
76
|
+
## Features
|
|
77
|
+
|
|
78
|
+
**Session Management**
|
|
79
|
+
- Context manager support for automatic cleanup
|
|
80
|
+
- Manual session control when needed
|
|
81
|
+
- Browser, desktop, and code environments
|
|
82
|
+
|
|
83
|
+
**Browser Actions**
|
|
84
|
+
- Navigation: `navigate(url)`
|
|
85
|
+
- Mouse: `click()`, `double_click()`, `right_click()`, `drag()`
|
|
86
|
+
- Keyboard: `type()`, `hotkey()`
|
|
87
|
+
- Viewport: `scroll()`, `set_viewport()`
|
|
88
|
+
- Capture: `screenshot()`, `html()`
|
|
89
|
+
- Debug: Execute shell commands with `debug()`
|
|
90
|
+
|
|
91
|
+
**Type Safety**
|
|
92
|
+
- Full type annotations for IDE autocomplete
|
|
93
|
+
- Pydantic models for responses
|
|
94
|
+
- TypedDict for request parameters
|
|
95
|
+
- Helper methods for result extraction
|
|
96
|
+
|
|
97
|
+
## Examples
|
|
98
|
+
|
|
99
|
+
### Browser Automation
|
|
100
|
+
|
|
101
|
+
```python
|
|
102
|
+
with client.create(kind="browser") as computer:
|
|
103
|
+
# Navigate and interact
|
|
104
|
+
computer.navigate("https://github.com/login")
|
|
105
|
+
computer.click(300, 400)
|
|
106
|
+
computer.type("username")
|
|
107
|
+
computer.hotkey("Control", "a") # Select all
|
|
108
|
+
|
|
109
|
+
# Capture state
|
|
110
|
+
html_result = computer.html()
|
|
111
|
+
html = computer.get_html_content(html_result)
|
|
112
|
+
|
|
113
|
+
# Execute commands
|
|
114
|
+
debug_result = computer.debug("ls -la")
|
|
115
|
+
output = computer.get_debug_response(debug_result)
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
### Manual Session Management
|
|
119
|
+
|
|
120
|
+
```python
|
|
121
|
+
computer = client.create(kind="browser")
|
|
122
|
+
try:
|
|
123
|
+
computer.navigate("https://example.com")
|
|
124
|
+
screenshot = computer.screenshot()
|
|
125
|
+
finally:
|
|
126
|
+
computer.terminate()
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
### Async Support
|
|
130
|
+
|
|
131
|
+
```python
|
|
132
|
+
from tzafon import AsyncComputer
|
|
133
|
+
|
|
134
|
+
async with AsyncComputer() as client:
|
|
135
|
+
computer = await client.computers.create(kind="browser")
|
|
136
|
+
await client.computers.navigate(computer.id, url="https://example.com")
|
|
137
|
+
await client.computers.terminate(computer.id)
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
## Advanced Usage
|
|
141
|
+
|
|
142
|
+
### Raw SDK Access
|
|
143
|
+
|
|
144
|
+
The simplified wrapper uses the generated SDK under the hood. You can access it directly:
|
|
145
|
+
|
|
146
|
+
```python
|
|
147
|
+
# Low-level API
|
|
148
|
+
response = client.computers.create(kind="browser")
|
|
149
|
+
client.computers.navigate(response.id, url="https://example.com")
|
|
150
|
+
result = client.computers.capture_screenshot(response.id)
|
|
151
|
+
client.computers.terminate(response.id)
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
### Error Handling
|
|
155
|
+
|
|
156
|
+
```python
|
|
157
|
+
import tzafon
|
|
158
|
+
|
|
159
|
+
try:
|
|
160
|
+
with client.create(kind="browser") as computer:
|
|
161
|
+
computer.navigate("https://example.com")
|
|
162
|
+
except tzafon.RateLimitError:
|
|
163
|
+
print("Rate limit exceeded, back off")
|
|
164
|
+
except tzafon.AuthenticationError:
|
|
165
|
+
print("Invalid API key")
|
|
166
|
+
except tzafon.APIError as e:
|
|
167
|
+
print(f"API error: {e}")
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
### Configuration
|
|
171
|
+
|
|
172
|
+
```python
|
|
173
|
+
from tzafon import Computer
|
|
174
|
+
|
|
175
|
+
client = Computer(
|
|
176
|
+
api_key="your-api-key", # Or use TZAFON_API_KEY env var
|
|
177
|
+
base_url="https://...", # Optional: custom endpoint
|
|
178
|
+
timeout=120.0, # Request timeout in seconds
|
|
179
|
+
max_retries=2, # Retry failed requests
|
|
180
|
+
)
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
## API Reference
|
|
184
|
+
|
|
185
|
+
**Session Methods**
|
|
186
|
+
- `navigate(url)` - Navigate to URL
|
|
187
|
+
- `click(x, y)` - Click at coordinates
|
|
188
|
+
- `double_click(x, y)` - Double-click
|
|
189
|
+
- `right_click(x, y)` - Right-click
|
|
190
|
+
- `drag(x1, y1, x2, y2)` - Click and drag
|
|
191
|
+
- `type(text)` - Type text
|
|
192
|
+
- `hotkey(*keys)` - Press key combination
|
|
193
|
+
- `scroll(dx, dy)` - Scroll viewport
|
|
194
|
+
- `screenshot(base64=False)` - Capture screenshot
|
|
195
|
+
- `html(auto_detect_encoding=False)` - Get page HTML
|
|
196
|
+
- `debug(command, timeout_seconds=120, max_output_length=65536)` - Run shell command
|
|
197
|
+
- `set_viewport(width, height, scale_factor=1.0)` - Set viewport size
|
|
198
|
+
- `terminate()` - End session
|
|
199
|
+
|
|
200
|
+
**Helper Methods**
|
|
201
|
+
- `get_screenshot_url(result)` - Extract screenshot URL from result
|
|
202
|
+
- `get_html_content(result)` - Extract HTML from result
|
|
203
|
+
- `get_debug_response(result)` - Extract command output from result
|
|
204
|
+
|
|
205
|
+
## Error Codes
|
|
206
|
+
|
|
207
|
+
| Status | Error Type |
|
|
208
|
+
|--------|------------|
|
|
209
|
+
| 400 | `BadRequestError` |
|
|
210
|
+
| 401 | `AuthenticationError` |
|
|
211
|
+
| 403 | `PermissionDeniedError` |
|
|
212
|
+
| 404 | `NotFoundError` |
|
|
213
|
+
| 422 | `UnprocessableEntityError` |
|
|
214
|
+
| 429 | `RateLimitError` |
|
|
215
|
+
| ≥500 | `InternalServerError` |
|
|
216
|
+
|
|
217
|
+
## Documentation
|
|
218
|
+
|
|
219
|
+
- REST API: [docs.tzafon.ai](https://docs.tzafon.ai)
|
|
220
|
+
- Full API Reference: [api.md](https://github.com/tzafon/computer-python/tree/main/api.md)
|
|
221
|
+
- Contributing: [CONTRIBUTING.md](https://github.com/tzafon/computer-python/tree/main/CONTRIBUTING.md)
|
|
222
|
+
|
|
223
|
+
## Requirements
|
|
224
|
+
|
|
225
|
+
Python 3.8+
|
|
226
|
+
|
|
227
|
+
## License
|
|
228
|
+
|
|
229
|
+
See [LICENSE](https://github.com/tzafon/computer-python/tree/main/LICENSE)
|