A Python library for interacting with the trackerstatus.info API. Trackerstatus.info provides real-time status updates and historical data for various trackers, helping users monitor and analyze tracker performance.
pip install trackerstatus
poetry add trackerstatus
- Github repo: https://github.com/mauvehed/trackerstatus/
- Pip package: https://pypi.org/project/trackerstatus/
First, you need to initialize the APIClient and the specific endpoint class you want to use.
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)
To get the status of all BTN services use:
status = btn_api.get_btn_status()
print("Status:", status)
To get the latency of all BTN services:
latency = btn_api.get_btn_latency()
print("Latency:", latency)
To get the current uptime of all BTN services:
uptime = btn_api.get_btn_uptime()
print("Uptime:", uptime)
To get the best recorded uptime of all BTN services:
records = btn_api.get_btn_records()
print("Records:", records)
To get the current downtime of all BTN services:
downtime = btn_api.get_btn_downtime()
print("Downtime:", downtime)
To get all combined data of BTN services including status, latency, uptime, records, and downtime:
all_data = btn_api.get_btn_all()
print("All Data:", all_data)
To get the statuses of all trackers:
tracker_statuses = status_api.get_tracker_statuses()
print("Tracker Statuses:", tracker_statuses)
To run tests, you can use pytest. Make sure you have all development dependencies installed:
poetry install
poetry shell
pytest