tzafon 1.4.0__tar.gz → 2.0.1__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.
Potentially problematic release.
This version of tzafon might be problematic. Click here for more details.
- tzafon-2.0.1/.release-please-manifest.json +3 -0
- {tzafon-1.4.0 → tzafon-2.0.1}/CHANGELOG.md +12 -0
- {tzafon-1.4.0 → tzafon-2.0.1}/CONTRIBUTING.md +2 -2
- {tzafon-1.4.0 → tzafon-2.0.1}/PKG-INFO +40 -44
- {tzafon-1.4.0 → tzafon-2.0.1}/README.md +35 -39
- {tzafon-1.4.0 → tzafon-2.0.1}/pyproject.toml +4 -4
- {tzafon-1.4.0 → tzafon-2.0.1}/src/tzafon/_version.py +1 -1
- {tzafon-1.4.0 → tzafon-2.0.1}/src/tzafon/resources/computers.py +4 -4
- tzafon-1.4.0/.release-please-manifest.json +0 -3
- {tzafon-1.4.0 → tzafon-2.0.1}/.gitignore +0 -0
- {tzafon-1.4.0 → tzafon-2.0.1}/BATCH_API.md +0 -0
- {tzafon-1.4.0 → tzafon-2.0.1}/LICENSE +0 -0
- {tzafon-1.4.0 → tzafon-2.0.1}/SECURITY.md +0 -0
- {tzafon-1.4.0 → tzafon-2.0.1}/WRAPPER.md +0 -0
- {tzafon-1.4.0 → tzafon-2.0.1}/WRAPPER_FUNCTIONALITY.md +0 -0
- {tzafon-1.4.0 → tzafon-2.0.1}/api.md +0 -0
- {tzafon-1.4.0 → tzafon-2.0.1}/bin/check-release-environment +0 -0
- {tzafon-1.4.0 → tzafon-2.0.1}/bin/publish-pypi +0 -0
- {tzafon-1.4.0 → tzafon-2.0.1}/examples/.keep +0 -0
- {tzafon-1.4.0 → tzafon-2.0.1}/examples/batch_example.py +0 -0
- {tzafon-1.4.0 → tzafon-2.0.1}/examples/batch_example_simple.py +0 -0
- {tzafon-1.4.0 → tzafon-2.0.1}/examples/clean_api_example.py +0 -0
- {tzafon-1.4.0 → tzafon-2.0.1}/noxfile.py +0 -0
- {tzafon-1.4.0 → tzafon-2.0.1}/release-please-config.json +0 -0
- {tzafon-1.4.0 → tzafon-2.0.1}/requirements-dev.lock +0 -0
- {tzafon-1.4.0 → tzafon-2.0.1}/requirements.lock +0 -0
- {tzafon-1.4.0 → tzafon-2.0.1}/src/computer/lib/.keep +0 -0
- {tzafon-1.4.0 → tzafon-2.0.1}/src/tzafon/__init__.py +0 -0
- {tzafon-1.4.0 → tzafon-2.0.1}/src/tzafon/_base_client.py +0 -0
- {tzafon-1.4.0 → tzafon-2.0.1}/src/tzafon/_client.py +0 -0
- {tzafon-1.4.0 → tzafon-2.0.1}/src/tzafon/_compat.py +0 -0
- {tzafon-1.4.0 → tzafon-2.0.1}/src/tzafon/_constants.py +0 -0
- {tzafon-1.4.0 → tzafon-2.0.1}/src/tzafon/_exceptions.py +0 -0
- {tzafon-1.4.0 → tzafon-2.0.1}/src/tzafon/_files.py +0 -0
- {tzafon-1.4.0 → tzafon-2.0.1}/src/tzafon/_models.py +0 -0
- {tzafon-1.4.0 → tzafon-2.0.1}/src/tzafon/_qs.py +0 -0
- {tzafon-1.4.0 → tzafon-2.0.1}/src/tzafon/_resource.py +0 -0
- {tzafon-1.4.0 → tzafon-2.0.1}/src/tzafon/_response.py +0 -0
- {tzafon-1.4.0 → tzafon-2.0.1}/src/tzafon/_streaming.py +0 -0
- {tzafon-1.4.0 → tzafon-2.0.1}/src/tzafon/_types.py +0 -0
- {tzafon-1.4.0 → tzafon-2.0.1}/src/tzafon/_utils/__init__.py +0 -0
- {tzafon-1.4.0 → tzafon-2.0.1}/src/tzafon/_utils/_compat.py +0 -0
- {tzafon-1.4.0 → tzafon-2.0.1}/src/tzafon/_utils/_datetime_parse.py +0 -0
- {tzafon-1.4.0 → tzafon-2.0.1}/src/tzafon/_utils/_logs.py +0 -0
- {tzafon-1.4.0 → tzafon-2.0.1}/src/tzafon/_utils/_proxy.py +0 -0
- {tzafon-1.4.0 → tzafon-2.0.1}/src/tzafon/_utils/_reflection.py +0 -0
- {tzafon-1.4.0 → tzafon-2.0.1}/src/tzafon/_utils/_resources_proxy.py +0 -0
- {tzafon-1.4.0 → tzafon-2.0.1}/src/tzafon/_utils/_streams.py +0 -0
- {tzafon-1.4.0 → tzafon-2.0.1}/src/tzafon/_utils/_sync.py +0 -0
- {tzafon-1.4.0 → tzafon-2.0.1}/src/tzafon/_utils/_transform.py +0 -0
- {tzafon-1.4.0 → tzafon-2.0.1}/src/tzafon/_utils/_typing.py +0 -0
- {tzafon-1.4.0 → tzafon-2.0.1}/src/tzafon/_utils/_utils.py +0 -0
- {tzafon-1.4.0 → tzafon-2.0.1}/src/tzafon/batch_wrapper.py +0 -0
- {tzafon-1.4.0 → tzafon-2.0.1}/src/tzafon/client_extensions.py +0 -0
- {tzafon-1.4.0 → tzafon-2.0.1}/src/tzafon/py.typed +0 -0
- {tzafon-1.4.0 → tzafon-2.0.1}/src/tzafon/resources/__init__.py +0 -0
- {tzafon-1.4.0 → tzafon-2.0.1}/src/tzafon/types/__init__.py +0 -0
- {tzafon-1.4.0 → tzafon-2.0.1}/src/tzafon/types/action_result.py +0 -0
- {tzafon-1.4.0 → tzafon-2.0.1}/src/tzafon/types/computer_create_params.py +0 -0
- {tzafon-1.4.0 → tzafon-2.0.1}/src/tzafon/types/computer_execute_action_params.py +0 -0
- {tzafon-1.4.0 → tzafon-2.0.1}/src/tzafon/types/computer_execute_batch_params.py +0 -0
- {tzafon-1.4.0 → tzafon-2.0.1}/src/tzafon/types/computer_execute_batch_response.py +0 -0
- {tzafon-1.4.0 → tzafon-2.0.1}/src/tzafon/types/computer_keep_alive_response.py +0 -0
- {tzafon-1.4.0 → tzafon-2.0.1}/src/tzafon/types/computer_list_response.py +0 -0
- {tzafon-1.4.0 → tzafon-2.0.1}/src/tzafon/types/computer_navigate_params.py +0 -0
- {tzafon-1.4.0 → tzafon-2.0.1}/src/tzafon/types/computer_response.py +0 -0
- {tzafon-1.4.0 → tzafon-2.0.1}/src/tzafon/wrapper.py +0 -0
- {tzafon-1.4.0 → tzafon-2.0.1}/tests/__init__.py +0 -0
- {tzafon-1.4.0 → tzafon-2.0.1}/tests/api_resources/__init__.py +0 -0
- {tzafon-1.4.0 → tzafon-2.0.1}/tests/api_resources/test_computers.py +0 -0
- {tzafon-1.4.0 → tzafon-2.0.1}/tests/conftest.py +0 -0
- {tzafon-1.4.0 → tzafon-2.0.1}/tests/sample_file.txt +0 -0
- {tzafon-1.4.0 → tzafon-2.0.1}/tests/test_client.py +0 -0
- {tzafon-1.4.0 → tzafon-2.0.1}/tests/test_deepcopy.py +0 -0
- {tzafon-1.4.0 → tzafon-2.0.1}/tests/test_extract_files.py +0 -0
- {tzafon-1.4.0 → tzafon-2.0.1}/tests/test_files.py +0 -0
- {tzafon-1.4.0 → tzafon-2.0.1}/tests/test_models.py +0 -0
- {tzafon-1.4.0 → tzafon-2.0.1}/tests/test_qs.py +0 -0
- {tzafon-1.4.0 → tzafon-2.0.1}/tests/test_required_args.py +0 -0
- {tzafon-1.4.0 → tzafon-2.0.1}/tests/test_response.py +0 -0
- {tzafon-1.4.0 → tzafon-2.0.1}/tests/test_streaming.py +0 -0
- {tzafon-1.4.0 → tzafon-2.0.1}/tests/test_transform.py +0 -0
- {tzafon-1.4.0 → tzafon-2.0.1}/tests/test_utils/test_datetime_parse.py +0 -0
- {tzafon-1.4.0 → tzafon-2.0.1}/tests/test_utils/test_proxy.py +0 -0
- {tzafon-1.4.0 → tzafon-2.0.1}/tests/test_utils/test_typing.py +0 -0
- {tzafon-1.4.0 → tzafon-2.0.1}/tests/utils.py +0 -0
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 2.0.1 (2025-10-21)
|
|
4
|
+
|
|
5
|
+
Full Changelog: [v2.0.0...v2.0.1](https://github.com/tzafon/computer-python/compare/v2.0.0...v2.0.1)
|
|
6
|
+
|
|
7
|
+
## 2.0.0 (2025-10-20)
|
|
8
|
+
|
|
9
|
+
Full Changelog: [v1.4.0...v2.0.0](https://github.com/tzafon/computer-python/compare/v1.4.0...v2.0.0)
|
|
10
|
+
|
|
11
|
+
### Features
|
|
12
|
+
|
|
13
|
+
* **api:** manual updates ([29bf74f](https://github.com/tzafon/computer-python/commit/29bf74fecae0fe2aaa70a9f6f5f7ca64ba5ddbff))
|
|
14
|
+
|
|
3
15
|
## 1.4.0 (2025-10-20)
|
|
4
16
|
|
|
5
17
|
Full Changelog: [v1.3.2...v1.4.0](https://github.com/atulgavandetzafon/computer-python/compare/v1.3.2...v1.4.0)
|
|
@@ -62,7 +62,7 @@ If you’d like to use the repository from source, you can either install from g
|
|
|
62
62
|
To install via git:
|
|
63
63
|
|
|
64
64
|
```sh
|
|
65
|
-
$ pip install git+ssh://git@github.com/
|
|
65
|
+
$ pip install git+ssh://git@github.com/tzafon/computer-python.git
|
|
66
66
|
```
|
|
67
67
|
|
|
68
68
|
Alternatively, you can build from source and install the wheel file:
|
|
@@ -120,7 +120,7 @@ the changes aren't made through the automated pipeline, you may want to make rel
|
|
|
120
120
|
|
|
121
121
|
### Publish with a GitHub workflow
|
|
122
122
|
|
|
123
|
-
You can release to package managers by using [the `Publish PyPI` GitHub action](https://www.github.com/
|
|
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
124
|
|
|
125
125
|
### Publish manually
|
|
126
126
|
|
|
@@ -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).
|
|
@@ -1,17 +1,19 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Tzafon Python SDK
|
|
2
2
|
|
|
3
3
|
<!-- prettier-ignore -->
|
|
4
4
|
[)](https://pypi.org/project/tzafon/)
|
|
5
5
|
|
|
6
|
-
The
|
|
7
|
-
application. The library includes type definitions for all request params and response fields,
|
|
8
|
-
and offers both synchronous and asynchronous clients powered by [httpx](https://github.com/encode/httpx).
|
|
6
|
+
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.
|
|
9
7
|
|
|
10
|
-
|
|
8
|
+
**Key Features:**
|
|
9
|
+
- Browser and desktop automation
|
|
10
|
+
- Synchronous and asynchronous clients powered by [httpx](https://github.com/encode/httpx)
|
|
11
|
+
- Type-safe API with full type definitions
|
|
12
|
+
- Context manager support for automatic cleanup
|
|
11
13
|
|
|
12
14
|
## Documentation
|
|
13
15
|
|
|
14
|
-
The REST API documentation can be found
|
|
16
|
+
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](api.md).
|
|
15
17
|
|
|
16
18
|
## Installation
|
|
17
19
|
|
|
@@ -22,53 +24,47 @@ pip install tzafon
|
|
|
22
24
|
|
|
23
25
|
## Usage
|
|
24
26
|
|
|
25
|
-
The full API of this library can be found in [api.md](api.md).
|
|
26
|
-
|
|
27
27
|
```python
|
|
28
|
-
import os
|
|
29
28
|
from tzafon import Computer
|
|
30
29
|
|
|
31
|
-
client = Computer(
|
|
32
|
-
api_key=os.environ.get("TZAFON_API_KEY"), # This is the default and can be omitted
|
|
33
|
-
)
|
|
30
|
+
client = Computer() # Reads TZAFON_API_KEY from environment
|
|
34
31
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
)
|
|
38
|
-
|
|
32
|
+
# Create and control a browser instance
|
|
33
|
+
with client.create(kind="browser") as computer:
|
|
34
|
+
computer.navigate("https://google.com")
|
|
35
|
+
computer.type("Tzafon AI")
|
|
36
|
+
computer.click(100, 200)
|
|
37
|
+
screenshot = computer.screenshot()
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
The client automatically reads `TZAFON_API_KEY` from your environment. You can also pass it explicitly:
|
|
41
|
+
|
|
42
|
+
```python
|
|
43
|
+
client = Computer(api_key="your-api-key")
|
|
39
44
|
```
|
|
40
45
|
|
|
41
|
-
|
|
42
|
-
we recommend using [python-dotenv](https://pypi.org/project/python-dotenv/)
|
|
43
|
-
to add `TZAFON_API_KEY="My API Key"` to your `.env` file
|
|
44
|
-
so that your API Key is not stored in source control.
|
|
46
|
+
We recommend using [python-dotenv](https://pypi.org/project/python-dotenv/) to manage your API key in a `.env` file.
|
|
45
47
|
|
|
46
|
-
## Async
|
|
48
|
+
## Async Usage
|
|
47
49
|
|
|
48
|
-
|
|
50
|
+
Import `AsyncComputer` and use `await` with each action:
|
|
49
51
|
|
|
50
52
|
```python
|
|
51
|
-
import os
|
|
52
53
|
import asyncio
|
|
53
54
|
from tzafon import AsyncComputer
|
|
54
55
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
)
|
|
64
|
-
print(computer_response.id)
|
|
65
|
-
|
|
56
|
+
async def main():
|
|
57
|
+
client = AsyncComputer()
|
|
58
|
+
|
|
59
|
+
async with client.create(kind="browser") as computer:
|
|
60
|
+
await computer.navigate("https://google.com")
|
|
61
|
+
await computer.type("Tzafon AI")
|
|
62
|
+
await computer.click(100, 200)
|
|
63
|
+
screenshot = await computer.screenshot()
|
|
66
64
|
|
|
67
65
|
asyncio.run(main())
|
|
68
66
|
```
|
|
69
67
|
|
|
70
|
-
Functionality between the synchronous and asynchronous clients is otherwise identical.
|
|
71
|
-
|
|
72
68
|
### With aiohttp
|
|
73
69
|
|
|
74
70
|
By default, the async client uses `httpx` for HTTP requests. However, for improved concurrency performance you may also use `aiohttp` as the HTTP backend.
|
|
@@ -264,9 +260,9 @@ computer = response.parse() # get the object that `computers.create()` would ha
|
|
|
264
260
|
print(computer.id)
|
|
265
261
|
```
|
|
266
262
|
|
|
267
|
-
These methods return an [`APIResponse`](https://github.com/
|
|
263
|
+
These methods return an [`APIResponse`](https://github.com/tzafon/computer-python/tree/main/src/tzafon/_response.py) object.
|
|
268
264
|
|
|
269
|
-
The async client returns an [`AsyncAPIResponse`](https://github.com/
|
|
265
|
+
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.
|
|
270
266
|
|
|
271
267
|
#### `.with_streaming_response`
|
|
272
268
|
|
|
@@ -372,7 +368,7 @@ This package generally follows [SemVer](https://semver.org/spec/v2.0.0.html) con
|
|
|
372
368
|
|
|
373
369
|
We take backwards-compatibility seriously and work hard to ensure you can rely on a smooth upgrade experience.
|
|
374
370
|
|
|
375
|
-
We are keen for your feedback; please open an [issue](https://www.github.com/
|
|
371
|
+
We are keen for your feedback; please open an [issue](https://www.github.com/tzafon/computer-python/issues) with questions, bugs, or suggestions.
|
|
376
372
|
|
|
377
373
|
### Determining the installed version
|
|
378
374
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "tzafon"
|
|
3
|
-
version = "
|
|
3
|
+
version = "2.0.1"
|
|
4
4
|
description = "The official Python library for the computer API"
|
|
5
5
|
dynamic = ["readme"]
|
|
6
6
|
license = "MIT"
|
|
@@ -35,8 +35,8 @@ classifiers = [
|
|
|
35
35
|
]
|
|
36
36
|
|
|
37
37
|
[project.urls]
|
|
38
|
-
Homepage = "https://github.com/
|
|
39
|
-
Repository = "https://github.com/
|
|
38
|
+
Homepage = "https://github.com/tzafon/computer-python"
|
|
39
|
+
Repository = "https://github.com/tzafon/computer-python"
|
|
40
40
|
|
|
41
41
|
[project.optional-dependencies]
|
|
42
42
|
aiohttp = ["aiohttp", "httpx_aiohttp>=0.1.9"]
|
|
@@ -124,7 +124,7 @@ path = "README.md"
|
|
|
124
124
|
[[tool.hatch.metadata.hooks.fancy-pypi-readme.substitutions]]
|
|
125
125
|
# replace relative links with absolute links
|
|
126
126
|
pattern = '\[(.+?)\]\(((?!https?://)\S+?)\)'
|
|
127
|
-
replacement = '[\1](https://github.com/
|
|
127
|
+
replacement = '[\1](https://github.com/tzafon/computer-python/tree/main/\g<2>)'
|
|
128
128
|
|
|
129
129
|
[tool.pytest.ini_options]
|
|
130
130
|
testpaths = ["tests"]
|
|
@@ -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
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|