Created
June 19, 2022 00:07
-
-
Save misterhay/eebc1e29243f52f69389d23c2cc98951 to your computer and use it in GitHub Desktop.
Python code for logging data to (and retrieving data from) EtherCalc.net
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
class_code = '5L' | |
value = 12 | |
from datetime import datetime | |
import requests | |
import pandas as pd | |
ethercalc_id = 'callysto' # can be the same as class_code, or randomly generated | |
base_url = 'https://ethercalc.net/' | |
post_url = base_url+'_/'+ethercalc_id | |
date_and_time = datetime.now().strftime("%Y-%m-%d %H:%M:%S") | |
r = requests.post(post_url, data= date_and_time +','+ str(class_code).upper() +','+ str(value)) | |
# get data | |
print('data from', base_url+ethercalc_id) | |
df = pd.read_csv(base_url+ethercalc_id+'.csv') | |
df |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment