Skip to content

Instantly share code, notes, and snippets.

@misterhay
Created June 19, 2022 00:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save misterhay/eebc1e29243f52f69389d23c2cc98951 to your computer and use it in GitHub Desktop.
Save misterhay/eebc1e29243f52f69389d23c2cc98951 to your computer and use it in GitHub Desktop.
Python code for logging data to (and retrieving data from) EtherCalc.net
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