trackerstatus
v0.2.0
ห้องสมุด Python สำหรับการโต้ตอบกับ trackerstatus.info API 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