https://github.com/terminalkitten/firetool
Command line tool to perform batch operation on Google Firebase real time database
https://github.com/terminalkitten/firetool
Last synced: 3 months ago
JSON representation
Command line tool to perform batch operation on Google Firebase real time database
- Host: GitHub
- URL: https://github.com/terminalkitten/firetool
- Owner: terminalkitten
- License: mit
- Created: 2018-04-09T02:03:51.000Z (about 7 years ago)
- Default Branch: develop
- Last Pushed: 2017-06-05T10:49:50.000Z (about 8 years ago)
- Last Synced: 2025-01-28T14:17:04.902Z (5 months ago)
- Language: Python
- Homepage:
- Size: 30.3 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
firetool is a command line tool to perform batch operation on Firebase real time database
It can perform list/copy/delete on the entire database in parallel.- Installing:
pip install firetool
# tested on Python2.7 and Python 3.5
For example assume the following db:root
└─ days
├─ 2017-01-01
│ ├─ name: foo
│ └─ id: 1
├─ 2017-01-02
│ ├─ name: bar
│ └─ id: 2
└─ 2017-01-03
├─ name: baz
└─ id: 3
- Listing:
firetool op list --path "days/(.*)/name" --project {project}
# This will return the values nodes matching --pathfiretool op list --path "days/(.*)/{name, id}" --project {project}
# This will return the values nodes matching --path- Copy:
firetool op copy --src "days/(\d{4})-(\d\d)-(\d\d)" --dest "days/\1/\2/\3"" --project {project}
# This will iterate over all the nodes mataching --src (using regex)
# and will copy the matching nodes into a --dest using regex groups matching
# The new tree will have those new nodesroot
└─ days
└─ 2017
└─ 01
├─ 01
│ ├─ name: foo
│ └─ id: 1
├─ 02
│ ├─ name: bar
│ └─ id: 2
└─ 03
├─ name: baz
└─ id: 3- Delete:
firetool op delete --path "days/(\d{4})-(\d\d)-(\d\d)" --project {project}
# This will delete all the nodes that matches the --path regex
- Remarks
- The operations copy and delete has the --dry switch to prevent from the operation to be destructive
- You need to authenticate using [firebase-tools](https://github.com/firebase/firebase-tools).
The same credentials will be used by both tools
- firetool is not affiliated with Google