Skip to content

Commit f344af9

Browse files
authored
Merge pull request #2 from beeper/release-please--branches--main--changes--next
release: 4.1.295
2 parents d0b2ca6 + 8a7c411 commit f344af9

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+5132
-371
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/beeper/desktop-api-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@v4
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.BEEPER_DESKTOP_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 == 'beeper/desktop-api-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@v4
16+
17+
- name: Check release environment
18+
run: |
19+
bash ./bin/check-release-environment
20+
env:
21+
PYPI_TOKEN: ${{ secrets.BEEPER_DESKTOP_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+
".": "4.1.295"
3+
}

.stats.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
configured_endpoints: 1
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/beeper%2Fbeeper-desktop-api-8c712fe19f280b0b89ecc8a3ce61e9f6b165cee97ce33f66c66a7a5db339c755.yml
3-
openapi_spec_hash: 1ea71129cc1a1ccc3dc8a99566082311
4-
config_hash: def03aa92de3408ec65438763617f5c7
1+
configured_endpoints: 15
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/beeper%2Fbeeper-desktop-api-0763b61997721da6f4514241bf0f7bb5f7a88c7298baf0f1b2d58036aaf7e2f1.yml
3+
openapi_spec_hash: 5158475919c04bb52fb03c6a4582188d
4+
config_hash: 5fa7ded4bfdffe4cc1944a819da87f9f

CHANGELOG.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Changelog
2+
3+
## 4.1.295 (2025-10-16)
4+
5+
Full Changelog: [v0.0.1...v4.1.295](https://github.com/beeper/desktop-api-python/compare/v0.0.1...v4.1.295)
6+
7+
### Features
8+
9+
* **api:** bump for new endpoints ([f63e0e4](https://github.com/beeper/desktop-api-python/commit/f63e0e48e35789609f9c589684ab03a9ca97b28d))
10+
* **api:** manual updates ([86218ff](https://github.com/beeper/desktop-api-python/commit/86218ff03f8a0cd42050b0c3babdf78178fda3da))
11+
* **api:** manual updates ([0fcd71f](https://github.com/beeper/desktop-api-python/commit/0fcd71f9951498d349fb816b42dc21347f3ab5dc))
12+
* **api:** manual updates ([dce7124](https://github.com/beeper/desktop-api-python/commit/dce712498ff2678222fd203118e7bb91f13ccfc5))
13+
* **api:** manual updates ([48b4b7f](https://github.com/beeper/desktop-api-python/commit/48b4b7f01064d016b84e954f9aa9f327863cc1d3))
14+
* **api:** manual updates ([c9f3b2d](https://github.com/beeper/desktop-api-python/commit/c9f3b2d3a7fb7e2ce3b30de215497079fff3aca9))
15+
* **api:** manual updates ([7c655fb](https://github.com/beeper/desktop-api-python/commit/7c655fb94ba070083173c15a501be7a0f119a38b))
16+
* **api:** manual updates ([88bce73](https://github.com/beeper/desktop-api-python/commit/88bce73dfef13b6a1cdef0749dc3078af97255e4))
17+
* **api:** manual updates ([1ea87ff](https://github.com/beeper/desktop-api-python/commit/1ea87ff08b4b50541e3c26bef6f4bd581af6324c))
18+
* **api:** manual updates ([b1ba1c0](https://github.com/beeper/desktop-api-python/commit/b1ba1c0584b99ab402f7c1643c13c19881baa600))
19+
* **api:** manual updates ([545ed69](https://github.com/beeper/desktop-api-python/commit/545ed69d7251f47a309f2f46ee4f3b8e4cf1cc60))
20+
* **api:** remove limit from list routes ([d5cb6c2](https://github.com/beeper/desktop-api-python/commit/d5cb6c2ee132bc3d558552df145082396c80521c))
21+
22+
23+
### Chores
24+
25+
* configure new SDK language ([d0b2ca6](https://github.com/beeper/desktop-api-python/commit/d0b2ca6bd2e9331cd42fe5143e0f94861502f11f))
26+
* configure new SDK language ([d11b464](https://github.com/beeper/desktop-api-python/commit/d11b4641e572db6ceb07bb4b9d47b97beadd9253))
27+
* **internal:** detect missing future annotations with ruff ([5e05845](https://github.com/beeper/desktop-api-python/commit/5e058450070fedbd9730bd6ec57fa392974d09e1))
28+
* update SDK settings ([8f54b9a](https://github.com/beeper/desktop-api-python/commit/8f54b9a9ed423fa039b5e59131cd69d7fa809d9e))
29+
* update SDK settings ([0d38dfa](https://github.com/beeper/desktop-api-python/commit/0d38dfa50d797ff879df6d5c633bbcb43c3a98fd))

CONTRIBUTING.md

Lines changed: 2 additions & 2 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/beeper-desktop-api-python.git
65+
$ pip install git+ssh://git@github.com/beeper/desktop-api-python.git
6666
```
6767

6868
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
120120

121121
### Publish with a GitHub workflow
122122

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

125125
### Publish manually
126126

README.md

Lines changed: 126 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,10 @@ The REST API documentation can be found on [developers.beeper.com](https://devel
1414
## Installation
1515

1616
```sh
17-
# install from this staging repo
18-
pip install git+ssh://git@github.com/stainless-sdks/beeper-desktop-api-python.git
17+
# install from PyPI
18+
pip install beeper_desktop_api
1919
```
2020

21-
> [!NOTE]
22-
> Once this package is [published to PyPI](https://www.stainless.com/docs/guides/publish), this will become: `pip install beeper_desktop_api`
23-
2421
## Usage
2522

2623
The full API of this library can be found in [api.md](api.md).
@@ -33,8 +30,12 @@ client = BeeperDesktop(
3330
access_token=os.environ.get("BEEPER_ACCESS_TOKEN"), # This is the default and can be omitted
3431
)
3532

36-
user_info = client.token.info()
37-
print(user_info.sub)
33+
page = client.chats.search(
34+
include_muted=True,
35+
limit=3,
36+
type="single",
37+
)
38+
print(page.items)
3839
```
3940

4041
While you can provide a `access_token` keyword argument,
@@ -57,8 +58,12 @@ client = AsyncBeeperDesktop(
5758

5859

5960
async def main() -> None:
60-
user_info = await client.token.info()
61-
print(user_info.sub)
61+
page = await client.chats.search(
62+
include_muted=True,
63+
limit=3,
64+
type="single",
65+
)
66+
print(page.items)
6267

6368

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

7580
```sh
76-
# install from this staging repo
77-
pip install 'beeper_desktop_api[aiohttp] @ git+ssh://git@github.com/stainless-sdks/beeper-desktop-api-python.git'
81+
# install from PyPI
82+
pip install beeper_desktop_api[aiohttp]
7883
```
7984

8085
Then you can enable it by instantiating the client with `http_client=DefaultAioHttpClient()`:
@@ -90,8 +95,12 @@ async def main() -> None:
9095
access_token="My Access Token",
9196
http_client=DefaultAioHttpClient(),
9297
) as client:
93-
user_info = await client.token.info()
94-
print(user_info.sub)
98+
page = await client.chats.search(
99+
include_muted=True,
100+
limit=3,
101+
type="single",
102+
)
103+
print(page.items)
95104

96105

97106
asyncio.run(main())
@@ -106,6 +115,100 @@ Nested request parameters are [TypedDicts](https://docs.python.org/3/library/typ
106115

107116
Typed requests and responses provide autocomplete and documentation within your editor. If you would like to see type errors in VS Code to help catch bugs earlier, set `python.analysis.typeCheckingMode` to `basic`.
108117

118+
## Pagination
119+
120+
List methods in the Beeper Desktop API are paginated.
121+
122+
This library provides auto-paginating iterators with each list response, so you do not have to request successive pages manually:
123+
124+
```python
125+
from beeper_desktop_api import BeeperDesktop
126+
127+
client = BeeperDesktop()
128+
129+
all_messages = []
130+
# Automatically fetches more pages as needed.
131+
for message in client.messages.search(
132+
account_ids=["local-telegram_ba_QFrb5lrLPhO3OT5MFBeTWv0x4BI"],
133+
limit=10,
134+
query="deployment",
135+
):
136+
# Do something with message here
137+
all_messages.append(message)
138+
print(all_messages)
139+
```
140+
141+
Or, asynchronously:
142+
143+
```python
144+
import asyncio
145+
from beeper_desktop_api import AsyncBeeperDesktop
146+
147+
client = AsyncBeeperDesktop()
148+
149+
150+
async def main() -> None:
151+
all_messages = []
152+
# Iterate through items across all pages, issuing requests as needed.
153+
async for message in client.messages.search(
154+
account_ids=["local-telegram_ba_QFrb5lrLPhO3OT5MFBeTWv0x4BI"],
155+
limit=10,
156+
query="deployment",
157+
):
158+
all_messages.append(message)
159+
print(all_messages)
160+
161+
162+
asyncio.run(main())
163+
```
164+
165+
Alternatively, you can use the `.has_next_page()`, `.next_page_info()`, or `.get_next_page()` methods for more granular control working with pages:
166+
167+
```python
168+
first_page = await client.messages.search(
169+
account_ids=["local-telegram_ba_QFrb5lrLPhO3OT5MFBeTWv0x4BI"],
170+
limit=10,
171+
query="deployment",
172+
)
173+
if first_page.has_next_page():
174+
print(f"will fetch next page using these details: {first_page.next_page_info()}")
175+
next_page = await first_page.get_next_page()
176+
print(f"number of items we just fetched: {len(next_page.items)}")
177+
178+
# Remove `await` for non-async usage.
179+
```
180+
181+
Or just work directly with the returned data:
182+
183+
```python
184+
first_page = await client.messages.search(
185+
account_ids=["local-telegram_ba_QFrb5lrLPhO3OT5MFBeTWv0x4BI"],
186+
limit=10,
187+
query="deployment",
188+
)
189+
190+
print(f"next page cursor: {first_page.oldest_cursor}") # => "next page cursor: ..."
191+
for message in first_page.items:
192+
print(message.id)
193+
194+
# Remove `await` for non-async usage.
195+
```
196+
197+
## Nested params
198+
199+
Nested parameters are dictionaries, typed using `TypedDict`, for example:
200+
201+
```python
202+
from beeper_desktop_api import BeeperDesktop
203+
204+
client = BeeperDesktop()
205+
206+
client.chats.reminders.create(
207+
chat_id="!NCdzlIaMjZUmvmvyHU:beeper.com",
208+
reminder={"remind_at_ms": 0},
209+
)
210+
```
211+
109212
## Handling errors
110213

111214
When the library is unable to connect to the API (for example, due to network connection problems or a timeout), a subclass of `beeper_desktop_api.APIConnectionError` is raised.
@@ -122,7 +225,7 @@ from beeper_desktop_api import BeeperDesktop
122225
client = BeeperDesktop()
123226

124227
try:
125-
client.token.info()
228+
client.accounts.list()
126229
except beeper_desktop_api.APIConnectionError as e:
127230
print("The server could not be reached")
128231
print(e.__cause__) # an underlying Exception, likely raised within httpx.
@@ -165,7 +268,7 @@ client = BeeperDesktop(
165268
)
166269

167270
# Or, configure per-request:
168-
client.with_options(max_retries=5).token.info()
271+
client.with_options(max_retries=5).accounts.list()
169272
```
170273

171274
### Timeouts
@@ -188,7 +291,7 @@ client = BeeperDesktop(
188291
)
189292

190293
# Override per-request:
191-
client.with_options(timeout=5.0).token.info()
294+
client.with_options(timeout=5.0).accounts.list()
192295
```
193296

194297
On timeout, an `APITimeoutError` is thrown.
@@ -229,16 +332,16 @@ The "raw" Response object can be accessed by prefixing `.with_raw_response.` to
229332
from beeper_desktop_api import BeeperDesktop
230333

231334
client = BeeperDesktop()
232-
response = client.token.with_raw_response.info()
335+
response = client.accounts.with_raw_response.list()
233336
print(response.headers.get('X-My-Header'))
234337

235-
token = response.parse() # get the object that `token.info()` would have returned
236-
print(token.sub)
338+
account = response.parse() # get the object that `accounts.list()` would have returned
339+
print(account)
237340
```
238341

239-
These methods return an [`APIResponse`](https://github.com/stainless-sdks/beeper-desktop-api-python/tree/main/src/beeper_desktop_api/_response.py) object.
342+
These methods return an [`APIResponse`](https://github.com/beeper/desktop-api-python/tree/main/src/beeper_desktop_api/_response.py) object.
240343

241-
The async client returns an [`AsyncAPIResponse`](https://github.com/stainless-sdks/beeper-desktop-api-python/tree/main/src/beeper_desktop_api/_response.py) with the same structure, the only difference being `await`able methods for reading the response content.
344+
The async client returns an [`AsyncAPIResponse`](https://github.com/beeper/desktop-api-python/tree/main/src/beeper_desktop_api/_response.py) with the same structure, the only difference being `await`able methods for reading the response content.
242345

243346
#### `.with_streaming_response`
244347

@@ -247,7 +350,7 @@ The above interface eagerly reads the full response body when you make the reque
247350
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.
248351

249352
```python
250-
with client.token.with_streaming_response.info() as response:
353+
with client.accounts.with_streaming_response.list() as response:
251354
print(response.headers.get("X-My-Header"))
252355

253356
for line in response.iter_lines():
@@ -342,7 +445,7 @@ This package generally follows [SemVer](https://semver.org/spec/v2.0.0.html) con
342445

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

345-
We are keen for your feedback; please open an [issue](https://www.github.com/stainless-sdks/beeper-desktop-api-python/issues) with questions, bugs, or suggestions.
448+
We are keen for your feedback; please open an [issue](https://www.github.com/beeper/desktop-api-python/issues) with questions, bugs, or suggestions.
346449

347450
### Determining the installed version
348451

0 commit comments

Comments
 (0)