--- id: mock-firestore version: "0.11.0" license: unclear license_treatment: permissive maintenance: dormant --- # mock-firestore — In-memory implementation of Google Cloud Firestore for use in tests License: permissive · Maintenance: dormant · Downloads: 139.6K/mo ## What it is and what it does mock-firestore is an in-memory implementation of the Google Cloud Firestore Python client, designed to replace the real client in unit tests. It mimics the same API surface—collections, documents, queries, transactions, and field transforms—so test code can use it as a drop-in substitute without hitting the live Firestore service. The package has no runtime dependencies and installs cleanly. The implementation is partial; not every Firestore operation is supported, but the description lists a substantial set of working operations including document CRUD, collection traversal, filtering with where clauses, ordering, limits, cursors, and transaction support. It's useful for fast, isolated unit tests where you need a Firestore-like interface but don't want network calls or cloud infrastructure. Reset the mock with reset() to clear state between tests. Use it for: - Unit test a Python application that uses Firestore without spinning up a real database or incurring cloud costs. - Develop and test Firestore queries and transactions locally before deploying to production. - Mock Firestore in CI/CD pipelines to run tests in parallel without database contention. - Test error handling and edge cases in Firestore code without risking real data. - Prototype Firestore-backed features before committing to cloud infrastructure. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Provides an in-memory mock of the Google Cloud Firestore Python client for use in unit tests, supporting collections, documents, queries, transactions, and field transforms without requiring a live database. Yes, if you are testing code that uses Firestore and want a lightweight, zero-dependency mock. The package is dormant (last release January 2022) but has no known vulnerabilities and works for its stated purpose. Install it only if your Firestore client API usage aligns with the partial feature set documented; verify coverage of the operations your code relies on before committing to it in your test suite. ## Install pip install mock-firestore uv add mock-firestore poetry add mock-firestore ## Installing mock-firestore Before you install: Low install friction with no runtime dependencies. Maintenance is dormant—last release was in January 2022 and the last commit in August 2024, so the package is not actively developed but remains available and functional for its stated purpose. License in practice: Licensed under MIT (permissive), so you can use it freely in commercial and private projects with minimal restrictions. Quickstart: pip install mock-firestore from mock_firestore import MockFirestore mock_db = MockFirestore() mock_db.collection('users').document('alice').set({'name': 'Alice'}) doc = mock_db.collection('users').document('alice').get() print(doc.to_dict()) Python 3.6+ is required. Verify before relying: - Extent of API coverage relative to the current Python Firestore client library—description notes 'only a partial implementation'. - Whether dormant maintenance (last release January 2022) poses a risk if Firestore client API has evolved significantly since then. ## Package facts - License: not declared (permissive) - Python support: unspecified - Install friction: low - Maintenance: dormant - Downloads: 139.6K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags firestore mock testing, in-memory firestore, firestore test double, firestore unit test, mock google cloud firestore, firestore fake database, firestore testing library, firestore, testing, mock [View on SkillFed](https://skillfed.io/packages/mock-firestore) · [View on PyPI](https://pypi.org/project/mock-firestore/)