Upload Data to Firebase Cloud Firestore with 10 lines of Python Code

The Point
4 min readAug 8, 2020

In this post I will show you how to import your local csv data into Firestore with only 10 lines of python code, and get data back from Firestore later on.

1. Set up Firebase project

First thing first, we need to set up a Firebase project. If you already have one, feel free to skip this step.

Go to Firebase and click the Go to console button at the top right of the page, then you will be able to Add project in the following page:

Set up the project name and select whether to add Google Analytics (I disabled this one here), then you will get your Firebase project ready!

Next, let’s create a Firestore database to store data. I chose to start in test mode here, so I don’t need to worry about the writing rules.

Here I’m using the PPP Loan Data from U.S. DEPARTMENT OF THE TREASURY, so I created a collection called ‘applications’ in the database. You can…