Install & Compatibility
Where this runs
tested against v0.11.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslpy 3.10–3.95 runs
installs and imports cleanly · install 0.0s · import 0.000s · 18MB
glibcpy 3.10–3.95 runs
installs and imports cleanly · install 1.5s · import 0.000s · 18MB
16MB installed
● package 16MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
MockFirestore
✓ from mockfirestore import MockFirestore
✗ from mock_firestore import MockFirestore
Create a MockFirestore instance and use it like the real Firestore client.
from mock_firestore import MockFirestore
firestore = MockFirestore()
# Add a document
doc_ref = firestore.collection('users').document('user1')
doc_ref.set({'name': 'Alice', 'email': 'alice@example.com'})
# Query
docs = firestore.collection('users').where('name', '==', 'Alice').stream()
for doc in docs:
print(doc.id, doc.to_dict())
# Output: user1 {'name': 'Alice', 'email': 'alice@example.com'}
Upgrade
Version history
0.11.0latest on PyPI · released Jan 24, 2022
Audit
Dependencies
google-cloud-firestorerequiredRequired for Firestore protocol types and data structures