def commit_data(data):
    '\n    This passes data to the data base as a single row. It then resets/empties data.\n    '
    url = 'http://localhost:1880/sensor'
    headers = {'Accepts': 'application/json'}
    print(f'1: {data[0]}')
    send_jsn = json.dumps({'Movements': data[0][1], 'Cups': data[0][2], 'Gallons': data[0][3], 'Liters': data[0][4]})
    try:
        response = requests.post(url, data=send_jsn, headers=headers)
        print(response.text)
    except (ConnectionError, Timeout, TooManyRedirects) as e:
        print(e)
    data = []
    return data
This passes data to the data base as a single row. It then resets/empties data.
def commit_data(data):
    '\n    \n    '
    url = 'http://localhost:1880/sensor'
    headers = {'Accepts': 'application/json'}
    print(f'1: {data[0]}')
    send_jsn = json.dumps({'Movements': data[0][1], 'Cups': data[0][2], 'Gallons': data[0][3], 'Liters': data[0][4]})
    try:
        response = requests.post(url, data=send_jsn, headers=headers)
        print(response.text)
    except (ConnectionError, Timeout, TooManyRedirects) as e:
        print(e)
    data = []
    return data