Giter Site home page Giter Site logo

pkarpovich / firestore2csv Goto Github PK

View Code? Open in Web Editor NEW
2.0 1.0 0.0 79 KB

Firestore to CSV Converter: A Python script that allows for easy exporting of Firestore collections to CSV files. It supports selective export of collections and auto-archives exported files into a tar.gz file for convenient storage and sharing

License: MIT License

Python 100.00%
csv export firebase firestore

firestore2csv's Introduction

Firestore to CSV Converter

This project contains a Python script for exporting data from Firebase Firestore into CSV format, managed using Poetry.

Description

This Python script allows you to export all documents from specified collections within your Firebase Firestore database into CSV files. The files are then compressed into a tar.gz file for convenience.

Features

  • Exports all documents from Firestore collections into CSV files
  • Can exclude specified collections
  • Automatically archives all CSV files into a tar.gz file

Requirements

You will need the following Python packages installed:

  • firebase_admin
  • google-cloud-firestore

These dependencies are specified in the pyproject.toml file and will be automatically managed by Poetry.

Installation

  1. Clone the repository:
  2. Navigate to the project directory
  3. Install Poetry if it isn't installed
  4. Install the project's dependencies

Usage

You can run the script using Poetry:

poetry run python main.py --cred-file <firebase-privateKey.json> --exclude <comma separated collection names to exclude> --output-dir <output directory>

Where:

  • cred-file is the path to your Firebase private key JSON file. Default is firebase-privateKey.json.
  • exclude is a comma-separated list of collections to exclude from the backup. By default, no collections are excluded.
  • output-dir is the path to the directory where the output tar.gz file will be saved. By default, files are saved in the backups directory in the current working directory

Example:

poetry run python main.py --cred-file firebase-privateKey.json --exclude users,logs --output-dir backups

License

This project is licensed under the terms of the MIT license. See the LICENSE file for details.

firestore2csv's People

Contributors

pkarpovich avatar

Stargazers

 avatar Makoto Tanji avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.