initial work on akahu client
This commit is contained in:
parent
5e840c1429
commit
55ee7e61b5
31
AkahuClient/akahuclient.py
Normal file
31
AkahuClient/akahuclient.py
Normal file
|
|
@ -0,0 +1,31 @@
|
||||||
|
import requests
|
||||||
|
import os
|
||||||
|
from dotenv import load_dotenv
|
||||||
|
|
||||||
|
load_dotenv()
|
||||||
|
|
||||||
|
|
||||||
|
class AkahuClient:
|
||||||
|
def __init__(self, token: str, app_id: str):
|
||||||
|
self.token = token
|
||||||
|
self.app_id = app_id
|
||||||
|
self.api_url = "https://api.akahu.io/v1"
|
||||||
|
self.headers = {
|
||||||
|
"Authorization": f"Bearer {self.token}",
|
||||||
|
"X-Akahu-Id": self.app_id,
|
||||||
|
"Accept": "application/json"
|
||||||
|
}
|
||||||
|
|
||||||
|
def get_accounts(self):
|
||||||
|
client = AkahuClient(self.token, self.app_id)
|
||||||
|
return client.get_accounts()
|
||||||
|
|
||||||
|
def get_transactions(self, account_id: str):
|
||||||
|
client = AkahuClient(self.token, self.app_id)
|
||||||
|
return client.get_transactions(account_id)
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
client = AkahuClient(TOKEN, APP_ID)
|
||||||
|
accounts = client.get_accounts()
|
||||||
|
print(accounts)
|
||||||
Loading…
Reference in a new issue