How to send image to firebase using python in raspberry pi

0 votes
Can somebody tell me how to send an image to firebase using python in raspberry pi?
Jun 23, 2020 in Python by Karan
• 19,610 points
3,293 views

1 answer to this question.

0 votes

Here's a code snippet demonstrating the same.

# Import gcloud
from google.cloud import storage

# Enable Storage
client = storage.Client()

# Reference an existing bucket.
bucket = client.get_bucket('projectid.appspot.com')

# Upload a local file to a new file to be created in your bucket.
zebraBlob = bucket.get_blob('zebra.jpg')
zebraBlob.upload_from_filename(filename='/photos/zoo/zebra.jpg')

# Download a file from your bucket.
giraffeBlob = bucket.get_blob('giraffe.jpg')
giraffeBlob.download_as_string()

For more info refer gcloud-python, and also using GCS APIs.

Hope this helps!

answered Jun 23, 2020 by Sam
• 6,260 points

Related Questions In Python

0 votes
1 answer

How to save an image locally using Python in which we already know the URL address?

Hi, @Roshni, The following code is used to ...READ MORE

answered Jun 26, 2020 in Python by Gitika
• 65,770 points
1,919 views
0 votes
1 answer

how to send post request to a webpage using cookies and headers in python to scrape the webpage ?

Hey @Avinash, Regarding your query, I would suggest ...READ MORE

answered Sep 29, 2020 in Python by Roshni
• 10,480 points
2,736 views
0 votes
2 answers

How to add image file in html using python

Hi, I have implemented as below from robot.api import ...READ MORE

answered Feb 9, 2021 in Python by anonymous
10,816 views
+1 vote
1 answer

How to create plots using python matplotlib in IPython notebook?

I think you should try: I used %matplotlib inline in ...READ MORE

answered Aug 8, 2018 in Python by Priyaj
• 58,020 points
1,616 views
0 votes
1 answer

How to resize image canvas to maintain square aspect ratio in Python, OpenCv

Building on Alexander-Reynolds answer above, here is ...READ MORE

answered Sep 4, 2018 in Python by Priyaj
• 58,020 points
5,219 views
0 votes
1 answer

How to save Numpy array as image in python?

If you have matplotlib, you can do: import ...READ MORE

answered Nov 16, 2018 in Python by Nymeria
• 3,560 points
8,978 views
0 votes
2 answers
+1 vote
2 answers

how can i count the items in a list?

Syntax :            list. count(value) Code: colors = ['red', 'green', ...READ MORE

answered Jul 7, 2019 in Python by Neha
• 330 points

edited Jul 8, 2019 by Kalgi 4,464 views
0 votes
1 answer
+5 votes
6 answers

Lowercase in Python

You can simply the built-in function in ...READ MORE

answered Apr 11, 2018 in Python by hemant
• 5,790 points
4,125 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP