tzafon 1.4.0__py3-none-any.whl → 2.0.1__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.
Potentially problematic release.
This version of tzafon might be problematic. Click here for more details.
- tzafon/_version.py +1 -1
- tzafon/resources/computers.py +4 -4
- {tzafon-1.4.0.dist-info → tzafon-2.0.1.dist-info}/METADATA +40 -44
- {tzafon-1.4.0.dist-info → tzafon-2.0.1.dist-info}/RECORD +6 -6
- {tzafon-1.4.0.dist-info → tzafon-2.0.1.dist-info}/WHEEL +0 -0
- {tzafon-1.4.0.dist-info → tzafon-2.0.1.dist-info}/licenses/LICENSE +0 -0
tzafon/_version.py
CHANGED
tzafon/resources/computers.py
CHANGED
|
@@ -37,7 +37,7 @@ class ComputersResource(SyncAPIResource):
|
|
|
37
37
|
This property can be used as a prefix for any HTTP method call to return
|
|
38
38
|
the raw response object instead of the parsed content.
|
|
39
39
|
|
|
40
|
-
For more information, see https://www.github.com/
|
|
40
|
+
For more information, see https://www.github.com/tzafon/computer-python#accessing-raw-response-data-eg-headers
|
|
41
41
|
"""
|
|
42
42
|
return ComputersResourceWithRawResponse(self)
|
|
43
43
|
|
|
@@ -46,7 +46,7 @@ class ComputersResource(SyncAPIResource):
|
|
|
46
46
|
"""
|
|
47
47
|
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
|
48
48
|
|
|
49
|
-
For more information, see https://www.github.com/
|
|
49
|
+
For more information, see https://www.github.com/tzafon/computer-python#with_streaming_response
|
|
50
50
|
"""
|
|
51
51
|
return ComputersResourceWithStreamingResponse(self)
|
|
52
52
|
|
|
@@ -367,7 +367,7 @@ class AsyncComputersResource(AsyncAPIResource):
|
|
|
367
367
|
This property can be used as a prefix for any HTTP method call to return
|
|
368
368
|
the raw response object instead of the parsed content.
|
|
369
369
|
|
|
370
|
-
For more information, see https://www.github.com/
|
|
370
|
+
For more information, see https://www.github.com/tzafon/computer-python#accessing-raw-response-data-eg-headers
|
|
371
371
|
"""
|
|
372
372
|
return AsyncComputersResourceWithRawResponse(self)
|
|
373
373
|
|
|
@@ -376,7 +376,7 @@ class AsyncComputersResource(AsyncAPIResource):
|
|
|
376
376
|
"""
|
|
377
377
|
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
|
378
378
|
|
|
379
|
-
For more information, see https://www.github.com/
|
|
379
|
+
For more information, see https://www.github.com/tzafon/computer-python#with_streaming_response
|
|
380
380
|
"""
|
|
381
381
|
return AsyncComputersResourceWithStreamingResponse(self)
|
|
382
382
|
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: tzafon
|
|
3
|
-
Version:
|
|
3
|
+
Version: 2.0.1
|
|
4
4
|
Summary: The official Python library for the computer API
|
|
5
|
-
Project-URL: Homepage, https://github.com/
|
|
6
|
-
Project-URL: Repository, https://github.com/
|
|
5
|
+
Project-URL: Homepage, https://github.com/tzafon/computer-python
|
|
6
|
+
Project-URL: Repository, https://github.com/tzafon/computer-python
|
|
7
7
|
Author-email: Computer <atul.gavande@tzafon.ai>
|
|
8
8
|
License: MIT
|
|
9
9
|
Classifier: Intended Audience :: Developers
|
|
@@ -33,20 +33,22 @@ Requires-Dist: aiohttp; extra == 'aiohttp'
|
|
|
33
33
|
Requires-Dist: httpx-aiohttp>=0.1.9; extra == 'aiohttp'
|
|
34
34
|
Description-Content-Type: text/markdown
|
|
35
35
|
|
|
36
|
-
#
|
|
36
|
+
# Tzafon Python SDK
|
|
37
37
|
|
|
38
38
|
<!-- prettier-ignore -->
|
|
39
39
|
[)](https://pypi.org/project/tzafon/)
|
|
40
40
|
|
|
41
|
-
The
|
|
42
|
-
application. The library includes type definitions for all request params and response fields,
|
|
43
|
-
and offers both synchronous and asynchronous clients powered by [httpx](https://github.com/encode/httpx).
|
|
41
|
+
The Tzafon Python SDK provides programmatic control of Chromium browsers and Linux desktop environments. Automate web interactions with simple method calls - navigate, click, type, and capture screenshots.
|
|
44
42
|
|
|
45
|
-
|
|
43
|
+
**Key Features:**
|
|
44
|
+
- Browser and desktop automation
|
|
45
|
+
- Synchronous and asynchronous clients powered by [httpx](https://github.com/encode/httpx)
|
|
46
|
+
- Type-safe API with full type definitions
|
|
47
|
+
- Context manager support for automatic cleanup
|
|
46
48
|
|
|
47
49
|
## Documentation
|
|
48
50
|
|
|
49
|
-
The REST API documentation can be found
|
|
51
|
+
The REST API documentation can be found at [docs.tzafon.ai](https://docs.tzafon.ai). The full API of this library can be found in [api.md](https://github.com/tzafon/computer-python/tree/main/api.md).
|
|
50
52
|
|
|
51
53
|
## Installation
|
|
52
54
|
|
|
@@ -57,53 +59,47 @@ pip install tzafon
|
|
|
57
59
|
|
|
58
60
|
## Usage
|
|
59
61
|
|
|
60
|
-
The full API of this library can be found in [api.md](https://github.com/stainless-sdks/computer-python/tree/main/api.md).
|
|
61
|
-
|
|
62
62
|
```python
|
|
63
|
-
import os
|
|
64
63
|
from tzafon import Computer
|
|
65
64
|
|
|
66
|
-
client = Computer(
|
|
67
|
-
api_key=os.environ.get("TZAFON_API_KEY"), # This is the default and can be omitted
|
|
68
|
-
)
|
|
65
|
+
client = Computer() # Reads TZAFON_API_KEY from environment
|
|
69
66
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
)
|
|
73
|
-
|
|
67
|
+
# Create and control a browser instance
|
|
68
|
+
with client.create(kind="browser") as computer:
|
|
69
|
+
computer.navigate("https://google.com")
|
|
70
|
+
computer.type("Tzafon AI")
|
|
71
|
+
computer.click(100, 200)
|
|
72
|
+
screenshot = computer.screenshot()
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
The client automatically reads `TZAFON_API_KEY` from your environment. You can also pass it explicitly:
|
|
76
|
+
|
|
77
|
+
```python
|
|
78
|
+
client = Computer(api_key="your-api-key")
|
|
74
79
|
```
|
|
75
80
|
|
|
76
|
-
|
|
77
|
-
we recommend using [python-dotenv](https://pypi.org/project/python-dotenv/)
|
|
78
|
-
to add `TZAFON_API_KEY="My API Key"` to your `.env` file
|
|
79
|
-
so that your API Key is not stored in source control.
|
|
81
|
+
We recommend using [python-dotenv](https://pypi.org/project/python-dotenv/) to manage your API key in a `.env` file.
|
|
80
82
|
|
|
81
|
-
## Async
|
|
83
|
+
## Async Usage
|
|
82
84
|
|
|
83
|
-
|
|
85
|
+
Import `AsyncComputer` and use `await` with each action:
|
|
84
86
|
|
|
85
87
|
```python
|
|
86
|
-
import os
|
|
87
88
|
import asyncio
|
|
88
89
|
from tzafon import AsyncComputer
|
|
89
90
|
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
)
|
|
99
|
-
print(computer_response.id)
|
|
100
|
-
|
|
91
|
+
async def main():
|
|
92
|
+
client = AsyncComputer()
|
|
93
|
+
|
|
94
|
+
async with client.create(kind="browser") as computer:
|
|
95
|
+
await computer.navigate("https://google.com")
|
|
96
|
+
await computer.type("Tzafon AI")
|
|
97
|
+
await computer.click(100, 200)
|
|
98
|
+
screenshot = await computer.screenshot()
|
|
101
99
|
|
|
102
100
|
asyncio.run(main())
|
|
103
101
|
```
|
|
104
102
|
|
|
105
|
-
Functionality between the synchronous and asynchronous clients is otherwise identical.
|
|
106
|
-
|
|
107
103
|
### With aiohttp
|
|
108
104
|
|
|
109
105
|
By default, the async client uses `httpx` for HTTP requests. However, for improved concurrency performance you may also use `aiohttp` as the HTTP backend.
|
|
@@ -254,7 +250,7 @@ client.with_options(timeout=5.0).computers.create(
|
|
|
254
250
|
|
|
255
251
|
On timeout, an `APITimeoutError` is thrown.
|
|
256
252
|
|
|
257
|
-
Note that requests that time out are [retried twice by default](https://github.com/
|
|
253
|
+
Note that requests that time out are [retried twice by default](https://github.com/tzafon/computer-python/tree/main/#retries).
|
|
258
254
|
|
|
259
255
|
## Advanced
|
|
260
256
|
|
|
@@ -299,9 +295,9 @@ computer = response.parse() # get the object that `computers.create()` would ha
|
|
|
299
295
|
print(computer.id)
|
|
300
296
|
```
|
|
301
297
|
|
|
302
|
-
These methods return an [`APIResponse`](https://github.com/
|
|
298
|
+
These methods return an [`APIResponse`](https://github.com/tzafon/computer-python/tree/main/src/tzafon/_response.py) object.
|
|
303
299
|
|
|
304
|
-
The async client returns an [`AsyncAPIResponse`](https://github.com/
|
|
300
|
+
The async client returns an [`AsyncAPIResponse`](https://github.com/tzafon/computer-python/tree/main/src/tzafon/_response.py) with the same structure, the only difference being `await`able methods for reading the response content.
|
|
305
301
|
|
|
306
302
|
#### `.with_streaming_response`
|
|
307
303
|
|
|
@@ -407,7 +403,7 @@ This package generally follows [SemVer](https://semver.org/spec/v2.0.0.html) con
|
|
|
407
403
|
|
|
408
404
|
We take backwards-compatibility seriously and work hard to ensure you can rely on a smooth upgrade experience.
|
|
409
405
|
|
|
410
|
-
We are keen for your feedback; please open an [issue](https://www.github.com/
|
|
406
|
+
We are keen for your feedback; please open an [issue](https://www.github.com/tzafon/computer-python/issues) with questions, bugs, or suggestions.
|
|
411
407
|
|
|
412
408
|
### Determining the installed version
|
|
413
409
|
|
|
@@ -426,4 +422,4 @@ Python 3.8 or higher.
|
|
|
426
422
|
|
|
427
423
|
## Contributing
|
|
428
424
|
|
|
429
|
-
See [the contributing documentation](https://github.com/
|
|
425
|
+
See [the contributing documentation](https://github.com/tzafon/computer-python/tree/main/./CONTRIBUTING.md).
|
|
@@ -11,7 +11,7 @@ tzafon/_resource.py,sha256=EseuwN0R4kKBVcQnyF4NgCeRtc6-OrR8yWVI5fOYGHM,1112
|
|
|
11
11
|
tzafon/_response.py,sha256=Gaq-HHLZ76rKv515pCAMkfW4rbz_ManOH-7R640hrDE,28792
|
|
12
12
|
tzafon/_streaming.py,sha256=SavIdu5Tnaelw60s19mwFijhkdhdxh1fDqZ1AoIwC0g,10108
|
|
13
13
|
tzafon/_types.py,sha256=1kStHPi-XwmomGBE0xKVtz0mdRF4Svxb8NWZR4FaSiY,7236
|
|
14
|
-
tzafon/_version.py,sha256=
|
|
14
|
+
tzafon/_version.py,sha256=W8CPWajg5_TmDprx6dyviUKXU7bCFHtEBHRuzrzC570,158
|
|
15
15
|
tzafon/batch_wrapper.py,sha256=ESJGxScFZzdPwDTiCjCz6-QRsoB-_nxoZuHbN9HKbUE,3509
|
|
16
16
|
tzafon/client_extensions.py,sha256=Tn3SkDYNl0B8M3U8eE39KNLsazKpbztAQSmBVVmzgCQ,1964
|
|
17
17
|
tzafon/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -29,7 +29,7 @@ tzafon/_utils/_transform.py,sha256=NjCzmnfqYrsAikUHQig6N9QfuTVbKipuP3ur9mcNF-E,1
|
|
|
29
29
|
tzafon/_utils/_typing.py,sha256=N_5PPuFNsaygbtA_npZd98SVN1LQQvFTKL6bkWPBZGU,4786
|
|
30
30
|
tzafon/_utils/_utils.py,sha256=0dDqauUbVZEXV0NVl7Bwu904Wwo5eyFCZpQThhFNhyA,12253
|
|
31
31
|
tzafon/resources/__init__.py,sha256=2tbxQpPYxwl6BYAmWlSblYFfmeBEasXs9oxh3vXRG2M,591
|
|
32
|
-
tzafon/resources/computers.py,sha256=
|
|
32
|
+
tzafon/resources/computers.py,sha256=grGWVUW6JQuF02Yrup0hUY9_FLxcPXtZYdBL1yX68N8,31548
|
|
33
33
|
tzafon/types/__init__.py,sha256=kb0H5ErFRI_4U_KF2ElDt45ZTid6K1dyDjq5_VL_FKs,902
|
|
34
34
|
tzafon/types/action_result.py,sha256=RE4iCBcGaUWXirCBNsjf00jLl_s173NN8-gCMtKVs0g,374
|
|
35
35
|
tzafon/types/computer_create_params.py,sha256=G9rhhm8ckcLbG5tM-vHrgG19-jmfUVN0KMcHodjNs4g,553
|
|
@@ -40,7 +40,7 @@ tzafon/types/computer_keep_alive_response.py,sha256=H75ugeXG2CetcGgwwKE_cYmr_ujD
|
|
|
40
40
|
tzafon/types/computer_list_response.py,sha256=ABykSdzQgm_bNISk_F7GQaXWRB3WidA9tXuMjmNWZps,294
|
|
41
41
|
tzafon/types/computer_navigate_params.py,sha256=mK4JWt0fqafLuoXHdOh_I6j-hJY0Ub0nAUkadA20v38,294
|
|
42
42
|
tzafon/types/computer_response.py,sha256=agc6iysQzQR22edcoz84CuUpzQ7WLwsxEuo8ccwIbYc,404
|
|
43
|
-
tzafon-
|
|
44
|
-
tzafon-
|
|
45
|
-
tzafon-
|
|
46
|
-
tzafon-
|
|
43
|
+
tzafon-2.0.1.dist-info/METADATA,sha256=AB_Vysb5Im0YNKwb4IF840-clVvAXW3eK_H01njA5u0,13873
|
|
44
|
+
tzafon-2.0.1.dist-info/WHEEL,sha256=C2FUgwZgiLbznR-k0b_5k3Ai_1aASOXDss3lzCUsUug,87
|
|
45
|
+
tzafon-2.0.1.dist-info/licenses/LICENSE,sha256=ciLXi9zfEehb4Tnhy-M9I2WSRUpZjx-FK1TEChVqlDo,1048
|
|
46
|
+
tzafon-2.0.1.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|