Skip to content

Commit f10d12b

Browse files
Merge pull request #1 from unlayer/release-please--branches--main--changes--next
release: 0.1.0
2 parents 3901e44 + 08e2cd5 commit f10d12b

31 files changed

+667
-583
lines changed

.github/workflows/publish-pypi.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# This workflow is triggered when a GitHub release is created.
2+
# It can also be run manually to re-publish to PyPI in case it failed for some reason.
3+
# You can run this workflow by navigating to https://www.github.com/unlayer/unlayer-python/actions/workflows/publish-pypi.yml
4+
name: Publish PyPI
5+
on:
6+
workflow_dispatch:
7+
8+
release:
9+
types: [published]
10+
11+
jobs:
12+
publish:
13+
name: publish
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- uses: actions/checkout@v6
18+
19+
- name: Install Rye
20+
run: |
21+
curl -sSf https://rye.astral.sh/get | bash
22+
echo "$HOME/.rye/shims" >> $GITHUB_PATH
23+
env:
24+
RYE_VERSION: '0.44.0'
25+
RYE_INSTALL_OPTION: '--yes'
26+
27+
- name: Publish to PyPI
28+
run: |
29+
bash ./bin/publish-pypi
30+
env:
31+
PYPI_TOKEN: ${{ secrets.UNLAYER_PYPI_TOKEN || secrets.PYPI_TOKEN }}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: Release Doctor
2+
on:
3+
pull_request:
4+
branches:
5+
- main
6+
workflow_dispatch:
7+
8+
jobs:
9+
release_doctor:
10+
name: release doctor
11+
runs-on: ubuntu-latest
12+
if: github.repository == 'unlayer/unlayer-python' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch' || startsWith(github.head_ref, 'release-please') || github.head_ref == 'next')
13+
14+
steps:
15+
- uses: actions/checkout@v6
16+
17+
- name: Check release environment
18+
run: |
19+
bash ./bin/check-release-environment
20+
env:
21+
PYPI_TOKEN: ${{ secrets.UNLAYER_PYPI_TOKEN || secrets.PYPI_TOKEN }}

.release-please-manifest.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
".": "0.1.0"
3+
}

.stats.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 7
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/unlayer%2Funlayer-e77bc881d5cb6c68be6f3d3861ed021b99f6cde45ee28d3511abe284d888262e.yml
3-
openapi_spec_hash: 7e7fae1b919c5d337e8b22be2a24d3ed
4-
config_hash: ea554d62bfbb5e8ea43ebf0a274dec31
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/unlayer%2Funlayer-48f00d1c04c23fb4d1cb7cf4af4f56b0c920d758c1f06e06e5373e5b15e9c27d.yml
3+
openapi_spec_hash: 6ee2a94bb9840aceb4a6161c724ce46c
4+
config_hash: 249869757b6eb98ae3d58f2a47ce21e2

CHANGELOG.md

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# Changelog
2+
3+
## 0.1.0 (2026-02-24)
4+
5+
Full Changelog: [v0.0.1...v0.1.0](https://github.com/unlayer/unlayer-python/compare/v0.0.1...v0.1.0)
6+
7+
### Features
8+
9+
* **api:** api update ([e247358](https://github.com/unlayer/unlayer-python/commit/e24735806fc790506d1d3b9ee84954809bd02258))
10+
* **api:** api update ([1255c9b](https://github.com/unlayer/unlayer-python/commit/1255c9b3e6bd708eefb21313c022a1018a78fc3e))
11+
* **api:** api update ([3901e44](https://github.com/unlayer/unlayer-python/commit/3901e44ec76d4bdc1ae8055639d1121965f8e6c6))
12+
* **api:** api update ([e90df1d](https://github.com/unlayer/unlayer-python/commit/e90df1d06e53f40707ccc73610d797eaa3c51fa5))
13+
* **api:** api update ([d0bb085](https://github.com/unlayer/unlayer-python/commit/d0bb0855866ba1daf54f700415c01fcf752090f3))
14+
* **api:** api update ([39253ba](https://github.com/unlayer/unlayer-python/commit/39253ba25f6a5da8e18da9d564af41e0c7e4c0e7))
15+
* **api:** api update ([b65e14e](https://github.com/unlayer/unlayer-python/commit/b65e14e7a19564d228e7436bae27b35a9ede6693))
16+
* **api:** api update ([d83034d](https://github.com/unlayer/unlayer-python/commit/d83034df2dbb4dfc3ee96d101bcdce87dc66306f))
17+
* **api:** api update ([93b319e](https://github.com/unlayer/unlayer-python/commit/93b319e21ac5f484c9d3efa4a51fba4269fe6737))
18+
* **api:** api update ([dd927cc](https://github.com/unlayer/unlayer-python/commit/dd927cc54abf0b619091f71e91d778da87323043))
19+
* **api:** api update ([1a2f183](https://github.com/unlayer/unlayer-python/commit/1a2f183e4fd9a9e512a41855aa1b91b4d28d6bdf))
20+
* **api:** api update ([1cf5d8e](https://github.com/unlayer/unlayer-python/commit/1cf5d8e9a10c2b8684838fa628b1b864bbe74209))
21+
* **api:** api update ([35876ba](https://github.com/unlayer/unlayer-python/commit/35876ba78ab506c86a36ae8aead33bf3f04549a6))
22+
* **api:** api update ([eafe372](https://github.com/unlayer/unlayer-python/commit/eafe372ab530d1a516b6f88630060dd1e384a288))
23+
* **api:** api update ([db50139](https://github.com/unlayer/unlayer-python/commit/db5013964e0c7efdc485708d622c12fde20c9420))
24+
* **api:** api update ([37dfa82](https://github.com/unlayer/unlayer-python/commit/37dfa8228ed4158855318afb16b50dc71c78b1bb))
25+
* **api:** api update ([04d7f14](https://github.com/unlayer/unlayer-python/commit/04d7f14ec06f71d777b7624b8898e3594dcb88f0))
26+
* **api:** api update ([7dbfb1a](https://github.com/unlayer/unlayer-python/commit/7dbfb1aa7fa765b1750f6ed5a733f4cf584c9766))
27+
* **api:** api update ([51ce8ef](https://github.com/unlayer/unlayer-python/commit/51ce8ef8927b0824ccd847e0acf61cd57388ae0f))
28+
* **client:** add custom JSON encoder for extended type support ([16d4717](https://github.com/unlayer/unlayer-python/commit/16d4717e1dec685c212a6c7d74e969660cf7e03c))
29+
* **client:** add support for binary request streaming ([191bd18](https://github.com/unlayer/unlayer-python/commit/191bd18a0c2588e3742b49b2bb85c23f31c18367))
30+
31+
32+
### Bug Fixes
33+
34+
* use async_to_httpx_files in patch method ([f9bdb58](https://github.com/unlayer/unlayer-python/commit/f9bdb58b5c218d7310e8c3328fc79d2322bc7d24))
35+
36+
37+
### Chores
38+
39+
* **ci:** upgrade `actions/github-script` ([89356cd](https://github.com/unlayer/unlayer-python/commit/89356cd10af2df4ce00e52b3857e772c2ffdda9f))
40+
* configure new SDK language ([9596a35](https://github.com/unlayer/unlayer-python/commit/9596a35093e7c1a7bfb9c1a9da7319482ed4f9c8))
41+
* format all `api.md` files ([eaab341](https://github.com/unlayer/unlayer-python/commit/eaab341586836de0b5d88ccd15ba91bf5d9fb8a9))
42+
* **internal:** add `--fix` argument to lint script ([3402766](https://github.com/unlayer/unlayer-python/commit/340276634acd12227076b5b3fbc3a1d5a8aaaf2f))
43+
* **internal:** add missing files argument to base client ([011c5b3](https://github.com/unlayer/unlayer-python/commit/011c5b3e1d285ad929aa23fbd18f22ded6e37bc2))
44+
* **internal:** add request options to SSE classes ([8215016](https://github.com/unlayer/unlayer-python/commit/82150166172718373d5c625fcb2abd63b996d1c4))
45+
* **internal:** bump dependencies ([4796143](https://github.com/unlayer/unlayer-python/commit/47961438c81e3263207987628d1f00c04a117189))
46+
* **internal:** codegen related update ([d4e8db7](https://github.com/unlayer/unlayer-python/commit/d4e8db7de852054c9232097b80832e630383da0e))
47+
* **internal:** fix lint error on Python 3.14 ([e825b41](https://github.com/unlayer/unlayer-python/commit/e825b41fa160ab18110a59b28ffdf3c504d63407))
48+
* **internal:** make `test_proxy_environment_variables` more resilient ([17a5609](https://github.com/unlayer/unlayer-python/commit/17a5609325e6661d12910c96b3f41ecde33e5cf1))
49+
* **internal:** update `actions/checkout` version ([942160b](https://github.com/unlayer/unlayer-python/commit/942160b8a331a9d21fe2349fba265fd6fb520034))
50+
* speedup initial import ([a0429e9](https://github.com/unlayer/unlayer-python/commit/a0429e971dcf003df2bbfd2d523bea4aab46db76))
51+
* update mock server docs ([e835dc3](https://github.com/unlayer/unlayer-python/commit/e835dc37eab896b138333888f423ba0aae6f0958))
52+
* update SDK settings ([52e5d05](https://github.com/unlayer/unlayer-python/commit/52e5d054a25723d3798cd8a571cd48bc7625bce9))
53+
* update SDK settings ([63ab6f7](https://github.com/unlayer/unlayer-python/commit/63ab6f7d4fee33593fe9d3dfb6daa615bc00897e))

CONTRIBUTING.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ If you’d like to use the repository from source, you can either install from g
6262
To install via git:
6363

6464
```sh
65-
$ pip install git+ssh://git@github.com/stainless-sdks/unlayer-python.git
65+
$ pip install git+ssh://git@github.com/unlayer/unlayer-python.git
6666
```
6767

6868
Alternatively, you can build from source and install the wheel file:
@@ -88,8 +88,7 @@ $ pip install ./path-to-wheel-file.whl
8888
Most tests require you to [set up a mock server](https://github.com/stoplightio/prism) against the OpenAPI spec to run the tests.
8989

9090
```sh
91-
# you will need npm installed
92-
$ npx prism mock path/to/your/openapi.yml
91+
$ ./scripts/mock
9392
```
9493

9594
```sh
@@ -120,7 +119,7 @@ the changes aren't made through the automated pipeline, you may want to make rel
120119

121120
### Publish with a GitHub workflow
122121

123-
You can release to package managers by using [the `Publish PyPI` GitHub action](https://www.github.com/stainless-sdks/unlayer-python/actions/workflows/publish-pypi.yml). This requires a setup organization or repository secret to be set up.
122+
You can release to package managers by using [the `Publish PyPI` GitHub action](https://www.github.com/unlayer/unlayer-python/actions/workflows/publish-pypi.yml). This requires a setup organization or repository secret to be set up.
124123

125124
### Publish manually
126125

README.md

Lines changed: 38 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,10 @@ The full API of this library can be found in [api.md](api.md).
1616
## Installation
1717

1818
```sh
19-
# install from this staging repo
20-
pip install git+ssh://git@github.com/stainless-sdks/unlayer-python.git
19+
# install from PyPI
20+
pip install unlayer
2121
```
2222

23-
> [!NOTE]
24-
> Once this package is [published to PyPI](https://www.stainless.com/docs/guides/publish), this will become: `pip install unlayer`
25-
2623
## Usage
2724

2825
The full API of this library can be found in [api.md](api.md).
@@ -32,21 +29,20 @@ import os
3229
from unlayer import Unlayer
3330

3431
client = Unlayer(
35-
access_token=os.environ.get("UNLAYER_ACCESS_TOKEN"), # This is the default and can be omitted
36-
# or 'production' | 'qa' | 'dev'; defaults to "production".
37-
environment="stage",
32+
api_key=os.environ.get("UNLAYER_API_KEY"), # This is the default and can be omitted
3833
)
3934

40-
project = client.project.retrieve(
35+
page = client.templates.list(
36+
limit=10,
4137
project_id="your-project-id",
4238
)
43-
print(project.data)
39+
print(page.data)
4440
```
4541

46-
While you can provide a `access_token` keyword argument,
42+
While you can provide an `api_key` keyword argument,
4743
we recommend using [python-dotenv](https://pypi.org/project/python-dotenv/)
48-
to add `UNLAYER_ACCESS_TOKEN="My Access Token"` to your `.env` file
49-
so that your Access Token is not stored in source control.
44+
to add `UNLAYER_API_KEY="My API Key"` to your `.env` file
45+
so that your API Key is not stored in source control.
5046

5147
## Async usage
5248

@@ -58,17 +54,16 @@ import asyncio
5854
from unlayer import AsyncUnlayer
5955

6056
client = AsyncUnlayer(
61-
access_token=os.environ.get("UNLAYER_ACCESS_TOKEN"), # This is the default and can be omitted
62-
# or 'production' | 'qa' | 'dev'; defaults to "production".
63-
environment="stage",
57+
api_key=os.environ.get("UNLAYER_API_KEY"), # This is the default and can be omitted
6458
)
6559

6660

6761
async def main() -> None:
68-
project = await client.project.retrieve(
62+
page = await client.templates.list(
63+
limit=10,
6964
project_id="your-project-id",
7065
)
71-
print(project.data)
66+
print(page.data)
7267

7368

7469
asyncio.run(main())
@@ -83,8 +78,8 @@ By default, the async client uses `httpx` for HTTP requests. However, for improv
8378
You can enable this by installing `aiohttp`:
8479

8580
```sh
86-
# install from this staging repo
87-
pip install 'unlayer[aiohttp] @ git+ssh://git@github.com/stainless-sdks/unlayer-python.git'
81+
# install from PyPI
82+
pip install unlayer[aiohttp]
8883
```
8984

9085
Then you can enable it by instantiating the client with `http_client=DefaultAioHttpClient()`:
@@ -98,15 +93,14 @@ from unlayer import AsyncUnlayer
9893

9994
async def main() -> None:
10095
async with AsyncUnlayer(
101-
access_token=os.environ.get(
102-
"UNLAYER_ACCESS_TOKEN"
103-
), # This is the default and can be omitted
96+
api_key=os.environ.get("UNLAYER_API_KEY"), # This is the default and can be omitted
10497
http_client=DefaultAioHttpClient(),
10598
) as client:
106-
project = await client.project.retrieve(
99+
page = await client.templates.list(
100+
limit=10,
107101
project_id="your-project-id",
108102
)
109-
print(project.data)
103+
print(page.data)
110104

111105

112106
asyncio.run(main())
@@ -135,8 +129,8 @@ client = Unlayer()
135129
all_templates = []
136130
# Automatically fetches more pages as needed.
137131
for template in client.templates.list(
138-
project_id="your-project-id",
139132
limit=10,
133+
project_id="your-project-id",
140134
):
141135
# Do something with template here
142136
all_templates.append(template)
@@ -156,8 +150,8 @@ async def main() -> None:
156150
all_templates = []
157151
# Iterate through items across all pages, issuing requests as needed.
158152
async for template in client.templates.list(
159-
project_id="your-project-id",
160153
limit=10,
154+
project_id="your-project-id",
161155
):
162156
all_templates.append(template)
163157
print(all_templates)
@@ -170,8 +164,8 @@ Alternatively, you can use the `.has_next_page()`, `.next_page_info()`, or `.get
170164

171165
```python
172166
first_page = await client.templates.list(
173-
project_id="your-project-id",
174167
limit=10,
168+
project_id="your-project-id",
175169
)
176170
if first_page.has_next_page():
177171
print(f"will fetch next page using these details: {first_page.next_page_info()}")
@@ -185,8 +179,8 @@ Or just work directly with the returned data:
185179

186180
```python
187181
first_page = await client.templates.list(
188-
project_id="your-project-id",
189182
limit=10,
183+
project_id="your-project-id",
190184
)
191185

192186
print(f"next page cursor: {first_page.next_cursor}") # => "next page cursor: ..."
@@ -227,7 +221,8 @@ from unlayer import Unlayer
227221
client = Unlayer()
228222

229223
try:
230-
client.project.retrieve(
224+
client.templates.list(
225+
limit=10,
231226
project_id="your-project-id",
232227
)
233228
except unlayer.APIConnectionError as e:
@@ -272,7 +267,8 @@ client = Unlayer(
272267
)
273268

274269
# Or, configure per-request:
275-
client.with_options(max_retries=5).project.retrieve(
270+
client.with_options(max_retries=5).templates.list(
271+
limit=10,
276272
project_id="your-project-id",
277273
)
278274
```
@@ -297,7 +293,8 @@ client = Unlayer(
297293
)
298294

299295
# Override per-request:
300-
client.with_options(timeout=5.0).project.retrieve(
296+
client.with_options(timeout=5.0).templates.list(
297+
limit=10,
301298
project_id="your-project-id",
302299
)
303300
```
@@ -340,18 +337,19 @@ The "raw" Response object can be accessed by prefixing `.with_raw_response.` to
340337
from unlayer import Unlayer
341338

342339
client = Unlayer()
343-
response = client.project.with_raw_response.retrieve(
340+
response = client.templates.with_raw_response.list(
341+
limit=10,
344342
project_id="your-project-id",
345343
)
346344
print(response.headers.get('X-My-Header'))
347345

348-
project = response.parse() # get the object that `project.retrieve()` would have returned
349-
print(project.data)
346+
template = response.parse() # get the object that `templates.list()` would have returned
347+
print(template.id)
350348
```
351349

352-
These methods return an [`APIResponse`](https://github.com/stainless-sdks/unlayer-python/tree/main/src/unlayer/_response.py) object.
350+
These methods return an [`APIResponse`](https://github.com/unlayer/unlayer-python/tree/main/src/unlayer/_response.py) object.
353351

354-
The async client returns an [`AsyncAPIResponse`](https://github.com/stainless-sdks/unlayer-python/tree/main/src/unlayer/_response.py) with the same structure, the only difference being `await`able methods for reading the response content.
352+
The async client returns an [`AsyncAPIResponse`](https://github.com/unlayer/unlayer-python/tree/main/src/unlayer/_response.py) with the same structure, the only difference being `await`able methods for reading the response content.
355353

356354
#### `.with_streaming_response`
357355

@@ -360,7 +358,8 @@ The above interface eagerly reads the full response body when you make the reque
360358
To stream the response body, use `.with_streaming_response` instead, which requires a context manager and only reads the response body once you call `.read()`, `.text()`, `.json()`, `.iter_bytes()`, `.iter_text()`, `.iter_lines()` or `.parse()`. In the async client, these are async methods.
361359

362360
```python
363-
with client.project.with_streaming_response.retrieve(
361+
with client.templates.with_streaming_response.list(
362+
limit=10,
364363
project_id="your-project-id",
365364
) as response:
366365
print(response.headers.get("X-My-Header"))
@@ -457,7 +456,7 @@ This package generally follows [SemVer](https://semver.org/spec/v2.0.0.html) con
457456

458457
We take backwards-compatibility seriously and work hard to ensure you can rely on a smooth upgrade experience.
459458

460-
We are keen for your feedback; please open an [issue](https://www.github.com/stainless-sdks/unlayer-python/issues) with questions, bugs, or suggestions.
459+
We are keen for your feedback; please open an [issue](https://www.github.com/unlayer/unlayer-python/issues) with questions, bugs, or suggestions.
461460

462461
### Determining the installed version
463462

api.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ Methods:
2424

2525
- <code title="post /v3/convert/simple-to-full">client.convert.simple_to_full.<a href="./src/unlayer/resources/convert/simple_to_full.py">create</a>(\*\*<a href="src/unlayer/types/convert/simple_to_full_create_params.py">params</a>) -> <a href="./src/unlayer/types/convert/simple_to_full_create_response.py">SimpleToFullCreateResponse</a></code>
2626

27-
# Project
27+
# Projects
2828

2929
Types:
3030

@@ -34,7 +34,7 @@ from unlayer.types import ProjectRetrieveResponse
3434

3535
Methods:
3636

37-
- <code title="get /v3/project">client.project.<a href="./src/unlayer/resources/project.py">retrieve</a>(\*\*<a href="src/unlayer/types/project_retrieve_params.py">params</a>) -> <a href="./src/unlayer/types/project_retrieve_response.py">ProjectRetrieveResponse</a></code>
37+
- <code title="get /v3/projects/{id}">client.projects.<a href="./src/unlayer/resources/projects.py">retrieve</a>(id) -> <a href="./src/unlayer/types/project_retrieve_response.py">ProjectRetrieveResponse</a></code>
3838

3939
# Templates
4040

0 commit comments

Comments
 (0)