Short python script to record data from Nanopool cryptocurrency mining account into Google sheets
- Requests (get JSON data from Nanopool API)
- Google Spreadsheets Python API (connect and write to Google spreadsheets)
- oauth2client (Authorization to connect to Google Sheets)
- JSON (parsing JSON data from Nanopool and credential file from Google)
- time (getting local time and date)
Nanopool provides API endpoints to extract various kinds of data for your mining pool:
Choose one to get the relevent data you need.
Proper credentials have to be generated and applied for your script to be able to connect and write to the google sheets:
The main list of gspread API references are given here:
In this script the sheet file to be written to is selected using the url: gclient.open_by_url(url)
The sheet is selected using the index, which is zero-indexed: worksheet.get_worksheet(index)
The list of values are appened to the worksheet: sheet.append_row(value_list)
Be sure to delete any existing empty rows, as the values will only be appended after those empty rows.