made some work for pastedb / pastecache..
This commit is contained in:
20
btc_tracker/01042023/TheClient/bin/TheClient.py
Normal file
20
btc_tracker/01042023/TheClient/bin/TheClient.py
Normal file
@ -0,0 +1,20 @@
|
||||
|
||||
import os
|
||||
import configparser
|
||||
import requests
|
||||
from datetime import datetime
|
||||
from TheClient.database.db_utils import Database
|
||||
from TheClient.graphing.graph_utils import Graph
|
||||
|
||||
def load_config(config_file):
|
||||
config = configparser.ConfigParser()
|
||||
config.read(config_file)
|
||||
return config
|
||||
|
||||
def get_btc_price():
|
||||
response = requests.get('https://api.binance.com/api/v3/avgPrice', params={'symbol': 'BTCUSDT'})
|
||||
json_data = response.json()
|
||||
return float(json_data['price'])
|
||||
|
||||
def main():
|
||||
config = load_config(os.path.join(os.path.dirname(__file__), '..', 'config', 'The
|
Reference in New Issue
Block a user