GU

goduni/unihttp

Developer tools

このページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。 原文を見る

61 stars 品質 65 トレンド 21MIT

宣言的な API クライアントを作成するモダンなライブラリ.

概要

宣言的な API クライアントを作成するモダンなライブラリです。 - : 標準の Python タイプのヒントを使用して API メソッドを定義します。 - : 静的なタイプの点検のための完全なサポート。 - : httpx, httpx2, aiohttp, リクエスト, niquests, zapros, 標準ライブラリ urllib で動作します。 - : 強力なミドルウェアとエラー処理システム。 特定の HTTP バックエンド (推奨): 標準ライブラリの urllib バックエンド (UrllibSyncClient) は追加を必要としません。 普通の pip install unihttp で動作し、依存関係のない環境に便利です。 unihttp では、好みのシリアライズフレームワークを選択できます。 1.(推奨):標準Python型(データクラス、TypedDict)の高性能シリアライズ 2. : Pydanticモデルのネイティブサポート 3. : msgspecのネイティブサポート Structモデル — 既にモデルをstruct として定義し、それらを直接シリアライズさせたい場合に理想的です。 クライアントを初期化する際に、適切な dumper と response loader を渡す必要があります.

概要(AI 翻訳)

unihttp は、宣言的な API クライアントを作成するモダンなライブラリです。

ドキュメント

コンテンツの表

  • 特徴
  • インストール
  • シリアル化バックエンド
  • クイックスタート
    1. メソッドを定義する
    1. クライアントの実装戦略
  • マーカーの参照
  • ストリーミング方法
  • ミドルウェア
  • Per-CallとPer-Methodミドルウェア
  • エラー処理
    1. 方法レベルの処理
    1. クライアントレベルの処理
    1. ミドルウェアレベルの処理
    1. 応答体検証
  • カスタムJSONシリアライズ
  • アダプテックスのパワー
  • Pydanticの統合
  • msgspecの統合
  • エージェントスキル

##特徴

-Declarative:標準のPythonタイプのヒントを使用してAPIメソッドを定義します。

  • タイプ安全:静的タイプの点検のための完全なサポート。
  • **アグノスティック **: httpx, httpx2], [aiohttp]], [requests]], [zapros, および標準ライブラリ [urllib]]で動作します。
  • 拡張可能:強力なミドルウェアとエラー処理システム。

インストール

特定の HTTP バックエンド (推奨):

標準ライブラリ [urllib バックエンド ([UrllibSyncClient]) は、追加する必要はありません。 普通[pip install unihttpで箱から出ます。 依存性のない環境。

シリアル化バックエンド

このページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。

README

以下は原文 README の抜粋です。原文を見る。

unihttp

unihttp is a modern library for creating declarative API clients.

Documentation

Table of Contents

Features

  • Declarative: Define API methods using standard Python type hints.
  • Type-Safe: Full support for static type checking.
  • Backend Agnostic: Works with httpx, httpx2, aiohttp, requests, niquests, zapros and the standard library urllib.
  • Extensible: Powerful middleware and error handling systems.

Installation

pip install unihttp

To include a specific HTTP backend (recommended):

pip install "unihttp[httpx]"    # For HTTPX (Sync/Async) support
# OR
pip install "unihttp[httpx2]"   # For HTTPX2 (Sync/Async) support
# OR
pip install "unihttp[niquests]"  # For niquests (Sync/Async) support
# OR
pip install "unihttp[requests]" # For Requests (Sync) support
# OR
pip install "unihttp[aiohttp]"  # For Aiohttp (Async) support
# OR
pip install "unihttp[zapros]"   # For Zapros (Sync/Async) support

The standard library urllib backend (UrllibSyncClient) requires no extra — it works out of the box with a plain pip install unihttp, which is handy for dependency-free environments.

Serialization Backends

unihttp allows you to choose your preferred serialization framework:

  1. Adaptix (recommended): High-performance serialization for standard Python types (dataclasses, TypedDict).
GitHub で README 全文を見る

推奨ツール

別のキーワードを試すか、フィルタを外してください。

インストール

npx skillfish add goduni/unihttp
MCP 初心者?mcpskill.org のガイドから始めましょう →