This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from bs4 import BeautifulSoup | |
import urllib3 | |
import ssl | |
import pandas | |
from multiprocessing import Process | |
import tldextract | |
ssl._create_default_https_context = ssl._create_unverified_context | |
# Load data into pandas dataframe |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<body> | |
<style type="text/css"> | |
.tg {border-collapse:collapse;border-spacing:0;} | |
.tg td{font-family:Arial, sans-serif;font-size:14px;padding:10px 5px;border-style:solid;border-width:1px;overflow:hidden;word-break:normal;border-color:black;} | |
.tg th{font-family:Arial, sans-serif;font-size:14px;font-weight:normal;padding:10px 5px;border-style:solid;border-width:1px;overflow:hidden;word-break:normal;border-color:black;} | |
.tg .tg-0pky{border-color:inherit;text-align:left;vertical-align:top} | |
@media screen and (max-width: 767px) {.tg {width: auto !important;}.tg col {width: auto !important;}.tg-wrap {overflow-x: auto;-webkit-overflow-scrolling: touch;}}</style> | |
<div class="tg-wrap"><table class="tg"> | |
<tr> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def delta(exchange, currency): | |
try: | |
exchange.database.begin() | |
table = exchange.database[currency] | |
table_length = len(table) | |
date_1h = datetime.datetime.utcnow() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def ticker(exchange, currency): | |
try: | |
ticker = exchange.fetch_ticker(currency) | |
closing = ticker['last'] | |
timestamp = ticker['timestamp'] | |
open = ticker['open'] | |
high = ticker['high'] | |
low = ticker['low'] | |
volume = ticker['baseVolume'] |