Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/pkarpovich/firestore2csv
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
https://github.com/pkarpovich/firestore2csv
csv export firebase firestore
Last synced: 15 days ago
JSON representation
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
- Host: GitHub
- URL: https://github.com/pkarpovich/firestore2csv
- Owner: pkarpovich
- License: mit
- Created: 2023-07-11T13:05:18.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-11-28T23:47:43.000Z (about 1 year ago)
- Last Synced: 2024-11-14T06:30:48.677Z (3 months ago)
- Topics: csv, export, firebase, firestore
- Language: Python
- Homepage:
- Size: 77.1 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 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:
```bash
poetry run python main.py --cred-file --exclude --output-dir
```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 directoryExample:
```bash
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](LICENSE) file for details.