Skip to content

A python script for importing data into Firebase Cloud Firestore

License

Notifications You must be signed in to change notification settings

RobinCheptileh/simple-firestore-import

Repository files navigation

Simple Firestore Import

Easily import data into Firebase Cloud Firestore from json and yaml files.

Installation

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

Usage

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]

Note

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

Contributing

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.

License

The program is available as open source under the terms of the MIT License.

Code of Conduct

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.

About

A python script for importing data into Firebase Cloud Firestore

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages