exploring stat comparision
This commit is contained in:
1
sandbox/data-exploration/src/api/__init__.py
Normal file
1
sandbox/data-exploration/src/api/__init__.py
Normal file
@@ -0,0 +1 @@
|
||||
from .core import *
|
||||
20
sandbox/data-exploration/src/api/core.py
Normal file
20
sandbox/data-exploration/src/api/core.py
Normal file
@@ -0,0 +1,20 @@
|
||||
import requests
|
||||
|
||||
class Leetify:
|
||||
api_base_url = "https://api.leetify.com/api"
|
||||
profile_base_url = f"{api_base_url}/profile"
|
||||
match_base_url = f"{api_base_url}/games"
|
||||
|
||||
def __get_page(self, url: str) -> dict:
|
||||
resp = requests.get(url)
|
||||
return resp.json()
|
||||
|
||||
def get_profile(self, id: str) -> dict:
|
||||
url = f"{self.profile_base_url}/{id}"
|
||||
return self.__get_page(url)
|
||||
|
||||
def get_match(self, id: str) -> dict:
|
||||
url = f"{self.match_base_url}/{id}"
|
||||
return self.__get_page(url)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user