Skip to main content

A Python library for interacting with trackerstatus.info API.

Project description

trackerstatus

PyPI Python Version CodeQL Create release and notes

Mypy Run PyTests and Coverage

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.

Installation

Pip

pip install trackerstatus

Poetry

poetry add trackerstatus

Resources

Usage

Initialization

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)

Fetching All Tracker Statuses

statuses = status_api.get_tracker_statuses()
print(statuses)

Fetching BTN Status

To get the status of all BTN services use:

status = btn_api.get_btn_status()
print("Status:", status)

Fetching BTN Latency

To get the latency of all BTN services:

latency = btn_api.get_btn_latency()
print("Latency:", latency)

Fetching BTN Uptime

To get the current uptime of all BTN services:

uptime = btn_api.get_btn_uptime()
print("Uptime:", uptime)

Fetching BTN Records

To get the best recorded uptime of all BTN services:

records = btn_api.get_btn_records()
print("Records:", records)

Fetching BTN Downtime

To get the current downtime of all BTN services:

downtime = btn_api.get_btn_downtime()
print("Downtime:", downtime)

Fetching All BTN Data

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)

Fetching Tracker Statuses

To get the statuses of all trackers:

tracker_statuses = status_api.get_tracker_statuses()
print("Tracker Statuses:", tracker_statuses)

Running Tests

To run tests, you can use pytest. Make sure you have all development dependencies installed:

poetry install
pytest

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

trackerstatus-0.2.0.tar.gz (4.5 kB view details)

Uploaded Source

Built Distribution

trackerstatus-0.2.0-py3-none-any.whl (6.0 kB view details)

Uploaded Python 3

File details

Details for the file trackerstatus-0.2.0.tar.gz.

File metadata

  • Download URL: trackerstatus-0.2.0.tar.gz
  • Upload date:
  • Size: 4.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.12.3 Linux/6.5.0-1021-azure

File hashes

Hashes for trackerstatus-0.2.0.tar.gz
Algorithm Hash digest
SHA256 67126c6a2ffef8670af48562533fae46282f6abe17a5cdea2a1e5a88a6306934
MD5 1a9169f6b56d8f52f8e1300452504b70
BLAKE2b-256 de303d0d0cf7493e79c32f22a32f0640ca42d96915c419029c942a7c765ae4f9

See more details on using hashes here.

File details

Details for the file trackerstatus-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: trackerstatus-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 6.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.12.3 Linux/6.5.0-1021-azure

File hashes

Hashes for trackerstatus-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5d31dd39914d1f7200d2b2f5a2dafd32d47e26d4c20bfba567b7d349e2abf313
MD5 44cd42609c2bc0db6367a1671d6d4a83
BLAKE2b-256 223d223c299f567ba9a16411174001d8b8159c800847bc4b24783b4badb4d43e

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page