ORM for Firestore with cascade
Google Firestore ORM
This is yet another attempt to create an ORM for Google Firestore Database. This one is relatively simple one with not too many option to customize. In fact the entire source code is in one file firestore-ci.py.
- Provide multi-thread interface to simulate async interaction with firestore
- A truncate feature to only create fields with non-default values in firestore
- A cascade feature - This will be removed in future release
How to use?
- Install firestore-ci
pip install firestore-ci
- Save the GCP service-account json key in your project folder & give it a name. For e.g.
- Set the
GOOGLE_APPLICATION_CREDENTIALSenvironment variable to the json file. For e.g. in Linux
- Make your object model using
- Override the
__init__()method to add your fields
- Outside the model, call the
init()method of Firestore document. For e.g.
- Here is a sample
from firestore_ci import FirestoreDocument class User(FirestoreDocument): def __init__(self): super().__init__() self.name = str() self.email = str() User.init()
The unit test cases for this package can be found here. The test cases are self explanatory and reviewing them will help understanding this package better.
Release history Release notifications | RSS feed
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Hashes for firestore_ci-2020.8.15-py3-none-any.whl