简体   繁体   English

使用Python填充Firebase数据库

[英]Populate Firebase Database With Python

Is there a way to populate my firebase database from within python code? 有没有办法从python代码中填充我的Firebase数据库? Or is there not, because python isn't used to write web/iphone/or android apps? 还是没有,因为不使用python来编写Web / iPhone / Android应用程序?

My code is currently this: 我的代码当前是这样的:

  page = requests.get('http://www.eatlowcarbon.org/food-scores')
  from bs4 import BeautifulSoup
  soup = BeautifulSoup(page.content, 'html.parser')

  foodDict = {}
  aTag = soup.findAll('a', class_="food")

  for tag in aTag:
          name = tag.find("div", {'class':"name"}).text

          score = tag.find("div", {'class':"score"}).text
          foodDict[name] = score

And instead of putting the information in a dictionary, I'd like to put it in my firebase database. 而且,我不想将信息放入字典中,而是希望将其放入我的Firebase数据库中。

Firebase recently releases its admin SDK for python. Firebase最近发布了针对python的管理SDK。

You should definitely use it since it's officially supported. 由于它已得到官方支持,因此您绝对应该使用它。 Here's the link to the list of available sdk. 这是可用SDK列表的链接。

https://firebase.google.com/docs/admin/setup https://firebase.google.com/docs/admin/setup

它不是firebase,也不一定是解决方案,但也许可以选择使用亚马逊的关系数据库: http : //docs.aws.amazon.com/elasticbeanstalk/latest/dg/create-deploy-python-rds.html

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM