diff --git a/src/owlboard.py b/src/owlboard.py deleted file mode 100644 index d481d14..0000000 --- a/src/owlboard.py +++ /dev/null @@ -1,37 +0,0 @@ -import requests -from urllib.parse import urljoin - -class APIConnectionError(Exception): - # API Connection has failed - pass - -## CONTANTS - -API_TEST_PATH = "" -API_HEADCODE_PATH = "" -API_TRAIN_UID_PATH = "" - -class OwlBoard_API_Connection: - - def __init__(self, api_key, base_url): - self.api_key = api_key - self.base_url = base_url - - self.request_headers = { - 'Content-Type': 'application/json', - 'uuid': self.api_key - } - - if not self.test_connection(): - raise APIConnectionError(f"failed to connect to API at {self.base_url} with supplied API key") - - - def test_connection(self): - try: - request_url = urljoin(self.base_url, API_TEST_PATH) - response = requests.get(request_url, headers=self.request_headers) - response.raise_for_status() - return True - except requests.RequestException as e: - print(f"Connection rest failed: {e}") - return False \ No newline at end of file