tzafon 2.0.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 CHANGED
@@ -1,4 +1,4 @@
1
1
  # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
3
  __title__ = "tzafon"
4
- __version__ = "2.0.0" # x-release-please-version
4
+ __version__ = "2.0.1" # x-release-please-version
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: tzafon
3
- Version: 2.0.0
3
+ Version: 2.0.1
4
4
  Summary: The official Python library for the computer API
5
5
  Project-URL: Homepage, https://github.com/tzafon/computer-python
6
6
  Project-URL: Repository, https://github.com/tzafon/computer-python
@@ -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
- # Computer Python API library
36
+ # Tzafon Python SDK
37
37
 
38
38
  <!-- prettier-ignore -->
39
39
  [![PyPI version](https://img.shields.io/pypi/v/tzafon.svg?label=pypi%20(stable))](https://pypi.org/project/tzafon/)
40
40
 
41
- The Computer Python library provides convenient access to the Computer REST API from any Python 3.8+
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
- It is generated with [Stainless](https://www.stainless.com/).
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 on [docs.tzafon.ai](http://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).
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/tzafon/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
- computer_response = client.computers.create(
71
- kind="browser",
72
- )
73
- print(computer_response.id)
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
- While you can provide an `api_key` keyword argument,
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 usage
83
+ ## Async Usage
82
84
 
83
- Simply import `AsyncComputer` instead of `Computer` and use `await` with each API call:
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
- client = AsyncComputer(
91
- api_key=os.environ.get("TZAFON_API_KEY"), # This is the default and can be omitted
92
- )
93
-
94
-
95
- async def main() -> None:
96
- computer_response = await client.computers.create(
97
- kind="browser",
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.
@@ -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=Xmm32ma4YAHkxQx4hLPJNHlAICiNdMqTyjv4I-XvgEI,158
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
@@ -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-2.0.0.dist-info/METADATA,sha256=2iW9BlxMc1cqphygM0H--uVmqNEOAhvLr8nsSrozjUU,13902
44
- tzafon-2.0.0.dist-info/WHEEL,sha256=C2FUgwZgiLbznR-k0b_5k3Ai_1aASOXDss3lzCUsUug,87
45
- tzafon-2.0.0.dist-info/licenses/LICENSE,sha256=ciLXi9zfEehb4Tnhy-M9I2WSRUpZjx-FK1TEChVqlDo,1048
46
- tzafon-2.0.0.dist-info/RECORD,,
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