firestore-batch
A Python context manager for easy Google Forestore batched writes.
What it does for you
- Creates a new batch on entering.
- Takes care of the 500-operation limit. When the limit is hit, it commits accumulated operations to the database and creates a new batch.
- Commits all operations on exit.
Usage
Install with pip:
pip install firestore-batch
Use in your code:
# Initialize the app
from firebase_admin import initialize_app, firestore
initialize_app()
db = firestore.client()
# Make lots of batched writes
from firestore_batch import Batch
with Batch(db) as batch:
for i in range(1000):
batch.set(doc_ref, {f'property_{i}': f'value_{i}'})
Methods
set(),update(),delete()- as in the originalWriteBatchclass (see the documentation with usage examples and API Reference for theWriteBatchandDocumentReferenceclasses).
Metadata
Release files for firestore-batch 0.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| firestore_batch-0.0.1.tar.gz | 2.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| firestore_batch-0.0.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 5.1 kB
Release files / firestore_batch-0.0.1.tar.gz
| Download URL | firestore_batch-0.0.1.tar.gz |
|---|---|
| Size | 2.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
bb1908c9f5d5cce87366c27ae09e7f6e9e8bf0b27b9b07a778b9828b895b5ad4
|
|
BLAKE2b-256 checksum How to use checksums |
a2da008c5873d1cfb72516e56a68290164164f78e23e74230d72903f72309820
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.2.0 pkginfo/1.6.1 requests/2.24.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.9.0
|
Release files / firestore_batch-0.0.1-py3-none-any.whl
| Download URL | firestore_batch-0.0.1-py3-none-any.whl |
|---|---|
| Size | 3.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
1ba8323a9947147587e9ca07ca97bf610261301c2f0f0aa6e9bada60cd007031
|
|
BLAKE2b-256 checksum How to use checksums |
fb404426819cb502847fdea2801fc75e0c3312ec3d0d0ecebde935ba2276cfc4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.2.0 pkginfo/1.6.1 requests/2.24.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.9.0
|