首页 > 解决方案 > 将 JSON 数据从 Python 更新到 Firebase

问题描述

我有来自我的传感器的数据,我用我的Raspberry 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每小时?

标签: pythonjson

解决方案


推荐阅读