<commit_before>import uuid
import base64
import uuid
import os
import sys
import json
sys.path.append(
    os.path.abspath(os.path.join(os.path.dirname(__file__), os.path.pardir)))

from datetime import datetime
from dateutil.tz import tzlocal
from modules.sensor import getTempC, getHumidity
from modules.camera import captureImage
from db import bulkStore

# Get the current date/time with the timezone.

def loadConfig():
	with open('./config/recipe.json') as data_file:
	    data = json.load(data_file)
	    return data

config = loadConfig()

deviceID = "0000ad19b01"
pID = os.getpid()
appID = 1
# get a UUID - URL safe, Base64
def get_a_uuid():
    r_uuid = base64.urlsafe_b64encode(uuid.uuid4().bytes)
    return r_uuid.replace('=', '')

def capture():
	temp = getTempC()
	hum = getHumidity()
	eventID = get_a_uuid()
	imgName = config["PlantName"]+eventID
	captureImage(imgName)
	createdAt = str(datetime.now(tzlocal()))
	eventData = [{"appID": appID, "pID":pID, "deviceID":deviceID, "eventID":eventID, "event":"capture-temp", "eventVal": temp, "createdAt":createdAt },{"appID": appID, "pID":pID, "deviceID":deviceID, "eventID":eventID, "event":"capture-hum", "eventVal":hum, "createdAt":createdAt },{"appID": appID, "pID":pID, "deviceID":deviceID, "eventID":eventID, "event":"capture-img", "path":imgName, "createdAt":createdAt }]
	bulkStore(eventData)<commit_msg>Data logging format changed<commit_after>#!/usr/bin/python
# -*- coding: utf-8 -*-
import uuid
import base64
import uuid
import os
import sys
import json
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__),
                os.path.pardir)))

from datetime import datetime
from dateutil.tz import tzlocal
from modules.sensor import getTempC, getHumidity
from modules.camera import captureImage
from db import bulkStore


# Get the current date/time with the timezone.

def loadConfig():
    with open('./config/recipe.json') as data_file:
        data = json.load(data_file)
        return data


config = loadConfig()

deviceID = '0000ad19b01'
pID = os.getpid()
appID = 1


# get a UUID - URL safe, Base64

def get_a_uuid():
    r_uuid = base64.urlsafe_b64encode(uuid.uuid4().bytes)
    return r_uuid.replace('=', '')


def capture():
    temp = getTempC()
    hum = getHumidity()
    eventID = get_a_uuid()
    imgName = config['PlantName'] + eventID
    captureImage(imgName)
    createdAt = str(datetime.now(tzlocal()))
    eventData = [{
        'appID': appID,
        'pID': pID,
        'deviceID': deviceID,
        'eventID': eventID,
        'temp': temp,
        'hum': hum,
        'img-path': imgName,
        'createdAt': createdAt,
        }]
    bulkStore(eventData)



			
{'fraction_non_alphanumeric': 0.13843283582089552, 'fraction_numerical': 0.013805970149253732, 'mean_word_length': 4.048964218455744, 'pattern_counts': {'":': 21, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2431983', 'n_tokens_mistral': 945, 'n_tokens_neox': 909, 'n_words': 222}