Skip to main content
This guide walks you through everything you need to go from a blank Python environment to a fully working Firestore-backed application using Firestore Pydantic ODM. Each step builds on the previous one, and a complete runnable snippet is provided at the end so you can verify your setup immediately.

Complete Working Example

The snippet below combines every step above into a single asyncio.run() call you can copy, adjust the project_id and emulator_host, and run immediately:

Next Steps

Installation

Detailed install options, dependency versions, and credential setup for all environments.

Models

Learn how to define fields, aliases, nested objects, and model configuration.

Querying

Filters, ordering, pagination, projections, and collection-group queries.

Subcollections

Declare parent–child relationships and query deeply nested documents.

Batch Operations

Atomic multi-document writes and transactions.

Testing

Emulator setup and unit-test mocking strategies.