Easily import data into Firebase Cloud Firestore from json and yaml files.
Clone the repo:
$ git clone https://github.com/RobinCheptileh/simple-firestore-import.git
Move into the directory:
$ cd simple-firestore-import
Install dependencies:
$ pip install -r requirements.txt
Provide your Firebase or Google Cloud service account key, data file and the name of the collection.
$ simple-firestore-import.py [path/to/serviceAccount.json] [path/to/dataFile(.json|.yaml|.yml)] [name of collection]
Or without arguments:
$ simple-firestore-import.py
Path to serviceAccountKey.json: [path/to/serviceAccount.json]
Path to data file: [path/to/dataFile(.json|.yaml|.yml)]
Name of collection: [name of collection]
The program expects an array of objects (dictionaries) to work.
CORRECT DATA FILE FORMAT
[
{
"name": "Jane Doe",
"email": "janedoe@mail.com"
},
{
"name": "John Doe",
"email": "johndoe@mail.com"
}
]
---
- name: Jane Doe
email: janedoe@mail.com
- name: John Doe
email: johndoe@mail.com
Bug reports and pull requests are welcome on GitHub at https://github.com/robincheptileh/simple-firestore-import. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.
The program is available as open source under the terms of the MIT License.
Everyone interacting in the Simple Firestore Import project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the code of conduct.