trackerstatus
v0.2.0
TrackerStatus.info APIと対話するためのPythonライブラリ。 TrackerStatus.infoは、さまざまなトラッカーのリアルタイムステータスの更新と履歴データを提供し、ユーザーがトラッカーのパフォーマンスを監視および分析するのに役立ちます。
pip install trackerstatuspoetry add trackerstatusまず、使用するApiclientと特定のエンドポイントクラスを初期化する必要があります。
from trackerstatus . core import APIClient
from trackerstatus . endpoints . btn import BTNEndpoint
from trackerstatus . endpoints . status import StatusEndpoint
# Initialize the APIClient
client = APIClient ( base_url = 'https://btn.trackerstatus.info' )
# Initialize the BTN endpoint
btn_api = BTNEndpoint ( client = client )
# Initialize the Status endpoint
status_api = StatusEndpoint ( client = client ) statuses = status_api . get_tracker_statuses ()
print ( statuses )すべてのBTNサービスのステータスを取得するには:
status = btn_api . get_btn_status ()
print ( "Status:" , status )すべてのBTNサービスの遅延を取得するには:
latency = btn_api . get_btn_latency ()
print ( "Latency:" , latency )すべてのBTNサービスの現在の稼働時間を取得するには:
uptime = btn_api . get_btn_uptime ()
print ( "Uptime:" , uptime )すべてのBTNサービスの最高の記録された稼働時間を取得するには:
records = btn_api . get_btn_records ()
print ( "Records:" , records )すべてのBTNサービスの現在のダウンタイムを取得するには:
downtime = btn_api . get_btn_downtime ()
print ( "Downtime:" , downtime )ステータス、レイテンシ、アップタイム、レコード、ダウンタイムなど、BTNサービスのすべての結合データを取得するには:
all_data = btn_api . get_btn_all ()
print ( "All Data:" , all_data )すべてのトラッカーのステータスを取得するには:
tracker_statuses = status_api . get_tracker_statuses ()
print ( "Tracker Statuses:" , tracker_statuses )テストを実行するには、pytestを使用できます。すべての開発依存関係がインストールされていることを確認してください。
poetry install
poetry shell
pytest