macadmins / macadmins/jamf-pro-sdk-python

[Feature Request] Add async/await support to SDK

オープン
#73 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

enhancement
主要言語
Python
スター
69
フォーク
16
PR マージ指標
30日以内にマージされた PR はありません

説明

Proposal

Add native asynchronous (async/await) support to the Jamf Pro SDK, enabling use with modern async Python frameworks.

Features:

  • Async client classes: AsyncJamfProClient, AsyncProApi, AsyncClassicApi, AsyncJCDS2, and AsyncWebhooksClient
  • Async pagination & concurrency operations
  • Context manager support

Backwards compatibility is ensured as we would not be modifying existing synchronous code whatsoever.

Implementation Example
import asyncio
from jamf_pro_sdk import AsyncJamfProClient, ApiClientCredentialsProvider

async def main():
    async with AsyncJamfProClient(
        server="jamf.my.org",
        credentials=ApiClientCredentialsProvider("client_id", "client_secret")
    ) as client:
        # Single async operation
        computers = await client.classic_api.list_all_computers()
        
        # Concurrent operations
        computer_ids = [c.id for c in computers]
        async for computer in client.async_concurrent_api_requests(
            handler=client.classic_api.get_computer_by_id,
            arguments=computer_ids
        ):
            print(f"{computer.general.name}")

asyncio.run(main())

[!NOTE]
To support both sync and async operations, the SDK would use httpx instead of requests. However, httpx was built to be a viable replacement for requests.

Additional Details

This is a follow up to this slack convo. Happy to provide additional details/examples as needed!

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

まず、提案で名前が挙げられている既存の同期クライアントクラスと API クラスを整理し、次に現在の requests ベースのトランスポートを httpx に変更する場合にどうなるかを確認します。動作の起点として AsyncJamfProClient の例を使用してください。既存の同期動作を変更せずに、一覧にあるクライアントの非同期版がページネーション、並行性、コンテキストマネージャーをサポートすれば完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
python
領域
api, backend
issue の種類
機能追加
難易度
5/5
見積もり時間
1週間以上
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
25/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。