将Python中的JSON数据更新到Firebase中

将Python中的JSON数据更新到Firebase中,python,json,Python,Json,我有来自我的传感器的数据,我用我的树莓Pi控制这些数据。我将这些数据打包到一个JSON文件中。我想用Python编写一个程序,每小时更新一次数据,并将其上传到Firebase 到目前为止,我的代码如下所示: from firebase import firebase import requests import json from pprint import pprint with open (thejsondata) as data_file: data=json.load(data

我有来自我的传感器的数据,我用我的
树莓Pi
控制这些数据。我将这些数据打包到一个
JSON
文件中。我想用
Python
编写一个程序,每小时更新一次数据,并将其上传到
Firebase

到目前为止,我的代码如下所示:

from firebase import firebase
import requests
import json
from pprint import pprint

with open (thejsondata) as data_file:
    data=json.load(data_file)
pprint(data)

firebase=firebase.FirebaseApplication("...")

r2 = requests.put("https://testproject...",data=jsondata)
print(r2)

如何每小时将其上传到
Firebase

如果使用LinuxOK,您可以配置作业,可以帮助我吗?:)当然也许能帮你开始