parallel-web 0.1.0__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 parallel-web might be problematic. Click here for more details.
- parallel_web-0.1.0/.gitignore +16 -0
- parallel_web-0.1.0/.release-please-manifest.json +3 -0
- parallel_web-0.1.0/CHANGELOG.md +16 -0
- parallel_web-0.1.0/CONTRIBUTING.md +129 -0
- parallel_web-0.1.0/LICENSE +7 -0
- parallel_web-0.1.0/PKG-INFO +544 -0
- parallel_web-0.1.0/README.md +513 -0
- parallel_web-0.1.0/SECURITY.md +27 -0
- parallel_web-0.1.0/api.md +18 -0
- parallel_web-0.1.0/bin/check-release-environment +21 -0
- parallel_web-0.1.0/bin/publish-pypi +6 -0
- parallel_web-0.1.0/examples/.keep +4 -0
- parallel_web-0.1.0/mypy.ini +50 -0
- parallel_web-0.1.0/noxfile.py +9 -0
- parallel_web-0.1.0/pyproject.toml +207 -0
- parallel_web-0.1.0/release-please-config.json +66 -0
- parallel_web-0.1.0/requirements-dev.lock +104 -0
- parallel_web-0.1.0/requirements.lock +45 -0
- parallel_web-0.1.0/src/parallel/__init__.py +94 -0
- parallel_web-0.1.0/src/parallel/_base_client.py +1943 -0
- parallel_web-0.1.0/src/parallel/_client.py +403 -0
- parallel_web-0.1.0/src/parallel/_compat.py +230 -0
- parallel_web-0.1.0/src/parallel/_constants.py +16 -0
- parallel_web-0.1.0/src/parallel/_exceptions.py +108 -0
- parallel_web-0.1.0/src/parallel/_files.py +123 -0
- parallel_web-0.1.0/src/parallel/_models.py +803 -0
- parallel_web-0.1.0/src/parallel/_qs.py +150 -0
- parallel_web-0.1.0/src/parallel/_resource.py +43 -0
- parallel_web-0.1.0/src/parallel/_response.py +830 -0
- parallel_web-0.1.0/src/parallel/_streaming.py +333 -0
- parallel_web-0.1.0/src/parallel/_types.py +217 -0
- parallel_web-0.1.0/src/parallel/_utils/__init__.py +58 -0
- parallel_web-0.1.0/src/parallel/_utils/_logs.py +25 -0
- parallel_web-0.1.0/src/parallel/_utils/_proxy.py +62 -0
- parallel_web-0.1.0/src/parallel/_utils/_reflection.py +42 -0
- parallel_web-0.1.0/src/parallel/_utils/_streams.py +12 -0
- parallel_web-0.1.0/src/parallel/_utils/_sync.py +86 -0
- parallel_web-0.1.0/src/parallel/_utils/_transform.py +447 -0
- parallel_web-0.1.0/src/parallel/_utils/_typing.py +151 -0
- parallel_web-0.1.0/src/parallel/_utils/_utils.py +426 -0
- parallel_web-0.1.0/src/parallel/_version.py +4 -0
- parallel_web-0.1.0/src/parallel/lib/.keep +4 -0
- parallel_web-0.1.0/src/parallel/lib/__init__.py +0 -0
- parallel_web-0.1.0/src/parallel/lib/_parsing/__init__.py +2 -0
- parallel_web-0.1.0/src/parallel/lib/_parsing/_task_run_result.py +100 -0
- parallel_web-0.1.0/src/parallel/lib/_parsing/_task_spec.py +93 -0
- parallel_web-0.1.0/src/parallel/lib/_pydantic.py +29 -0
- parallel_web-0.1.0/src/parallel/lib/_time.py +57 -0
- parallel_web-0.1.0/src/parallel/py.typed +0 -0
- parallel_web-0.1.0/src/parallel/resources/__init__.py +19 -0
- parallel_web-0.1.0/src/parallel/resources/task_run.py +643 -0
- parallel_web-0.1.0/src/parallel/types/__init__.py +12 -0
- parallel_web-0.1.0/src/parallel/types/json_schema_param.py +15 -0
- parallel_web-0.1.0/src/parallel/types/parsed_task_run_result.py +29 -0
- parallel_web-0.1.0/src/parallel/types/task_run.py +54 -0
- parallel_web-0.1.0/src/parallel/types/task_run_create_params.py +32 -0
- parallel_web-0.1.0/src/parallel/types/task_run_result.py +122 -0
- parallel_web-0.1.0/src/parallel/types/task_run_result_params.py +13 -0
- parallel_web-0.1.0/src/parallel/types/task_spec_param.py +35 -0
- parallel_web-0.1.0/src/parallel/types/text_schema_param.py +15 -0
- parallel_web-0.1.0/tests/__init__.py +1 -0
- parallel_web-0.1.0/tests/api_resources/__init__.py +1 -0
- parallel_web-0.1.0/tests/api_resources/test_task_run.py +336 -0
- parallel_web-0.1.0/tests/conftest.py +51 -0
- parallel_web-0.1.0/tests/sample_file.txt +1 -0
- parallel_web-0.1.0/tests/test_client.py +1659 -0
- parallel_web-0.1.0/tests/test_deepcopy.py +58 -0
- parallel_web-0.1.0/tests/test_extract_files.py +64 -0
- parallel_web-0.1.0/tests/test_files.py +51 -0
- parallel_web-0.1.0/tests/test_models.py +891 -0
- parallel_web-0.1.0/tests/test_qs.py +78 -0
- parallel_web-0.1.0/tests/test_required_args.py +111 -0
- parallel_web-0.1.0/tests/test_response.py +277 -0
- parallel_web-0.1.0/tests/test_streaming.py +248 -0
- parallel_web-0.1.0/tests/test_transform.py +453 -0
- parallel_web-0.1.0/tests/test_utils/test_proxy.py +23 -0
- parallel_web-0.1.0/tests/test_utils/test_typing.py +73 -0
- parallel_web-0.1.0/tests/utils.py +159 -0
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## 0.1.0 (2025-04-24)
|
|
4
|
+
|
|
5
|
+
Full Changelog: [v0.0.1-alpha.0...v0.1.0](https://github.com/shapleyai/parallel-sdk-python/compare/v0.0.1-alpha.0...v0.1.0)
|
|
6
|
+
|
|
7
|
+
### Features
|
|
8
|
+
|
|
9
|
+
* **api:** add execute method and structured output support ([5e51379](https://github.com/shapleyai/parallel-sdk-python/commit/5e51379e3ff28bdf70a3cc9167d4413bf3e8690c))
|
|
10
|
+
* **api:** update via SDK Studio ([c393d04](https://github.com/shapleyai/parallel-sdk-python/commit/c393d048bddb554c37eb750ca57c4335243a70ed))
|
|
11
|
+
* **api:** update via SDK Studio ([6698e71](https://github.com/shapleyai/parallel-sdk-python/commit/6698e716bdddcf2146cc802cfaaa26f7ddb4d3dc))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
### Chores
|
|
15
|
+
|
|
16
|
+
* go live ([061677a](https://github.com/shapleyai/parallel-sdk-python/commit/061677a22549f3dd3d9f4591c9ccfdf71209c12e))
|
|
@@ -0,0 +1,129 @@
|
|
|
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
|
+
$ rye shell
|
|
21
|
+
# or manually activate - https://docs.python.org/3/library/venv.html#how-venvs-work
|
|
22
|
+
$ source .venv/bin/activate
|
|
23
|
+
|
|
24
|
+
# now you can omit the `rye run` prefix
|
|
25
|
+
$ python script.py
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
### Without Rye
|
|
29
|
+
|
|
30
|
+
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:
|
|
31
|
+
|
|
32
|
+
```sh
|
|
33
|
+
$ pip install -r requirements-dev.lock
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
## Modifying/Adding code
|
|
37
|
+
|
|
38
|
+
Most of the SDK is generated code. Modifications to code will be persisted between generations, but may
|
|
39
|
+
result in merge conflicts between manual patches and changes from the generator. The generator will never
|
|
40
|
+
modify the contents of the `src/parallel/lib/` and `examples/` directories.
|
|
41
|
+
|
|
42
|
+
## Adding and running examples
|
|
43
|
+
|
|
44
|
+
All files in the `examples/` directory are not modified by the generator and can be freely edited or added to.
|
|
45
|
+
|
|
46
|
+
```py
|
|
47
|
+
# add an example to examples/<your-example>.py
|
|
48
|
+
|
|
49
|
+
#!/usr/bin/env -S rye run python
|
|
50
|
+
…
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
```sh
|
|
54
|
+
$ chmod +x examples/<your-example>.py
|
|
55
|
+
# run the example against your api
|
|
56
|
+
$ ./examples/<your-example>.py
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
## Using the repository from source
|
|
60
|
+
|
|
61
|
+
If you’d like to use the repository from source, you can either install from git or link to a cloned repository:
|
|
62
|
+
|
|
63
|
+
To install via git:
|
|
64
|
+
|
|
65
|
+
```sh
|
|
66
|
+
$ pip install git+ssh://git@github.com/shapleyai/parallel-sdk-python.git
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
Alternatively, you can build from source and install the wheel file:
|
|
70
|
+
|
|
71
|
+
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.
|
|
72
|
+
|
|
73
|
+
To create a distributable version of the library, all you have to do is run this command:
|
|
74
|
+
|
|
75
|
+
```sh
|
|
76
|
+
$ rye build
|
|
77
|
+
# or
|
|
78
|
+
$ python -m build
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
Then to install:
|
|
82
|
+
|
|
83
|
+
```sh
|
|
84
|
+
$ pip install ./path-to-wheel-file.whl
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
## Running tests
|
|
88
|
+
|
|
89
|
+
Most tests require you to [set up a mock server](https://github.com/stoplightio/prism) against the OpenAPI spec to run the tests.
|
|
90
|
+
|
|
91
|
+
```sh
|
|
92
|
+
# you will need npm installed
|
|
93
|
+
$ npx prism mock path/to/your/openapi.yml
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
```sh
|
|
97
|
+
$ ./scripts/test
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
## Linting and formatting
|
|
101
|
+
|
|
102
|
+
This repository uses [ruff](https://github.com/astral-sh/ruff) and
|
|
103
|
+
[black](https://github.com/psf/black) to format the code in the repository.
|
|
104
|
+
|
|
105
|
+
To lint:
|
|
106
|
+
|
|
107
|
+
```sh
|
|
108
|
+
$ ./scripts/lint
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
To format and fix all ruff issues automatically:
|
|
112
|
+
|
|
113
|
+
```sh
|
|
114
|
+
$ ./scripts/format
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
## Publishing and releases
|
|
118
|
+
|
|
119
|
+
Changes made to this repository via the automated release PR pipeline should publish to PyPI automatically. If
|
|
120
|
+
the changes aren't made through the automated pipeline, you may want to make releases manually.
|
|
121
|
+
|
|
122
|
+
### Publish with a GitHub workflow
|
|
123
|
+
|
|
124
|
+
You can release to package managers by using [the `Publish PyPI` GitHub action](https://www.github.com/shapleyai/parallel-sdk-python/actions/workflows/publish-pypi.yml). This requires a setup organization or repository secret to be set up.
|
|
125
|
+
|
|
126
|
+
### Publish manually
|
|
127
|
+
|
|
128
|
+
If you need to manually release a package, you can run the `bin/publish-pypi` script with a `PYPI_TOKEN` set on
|
|
129
|
+
the environment.
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
Copyright 2025 Parallel
|
|
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.
|