Skip to main content

A wrapper for creating model classes using Google's Cloud Firestore schemaless database

Project description


Quickly and simply create model classes for Google's Cloud Firestore schemaless database.


This project seeks to provide a similar convenience and utility for using Cloud Firestore with the newly available Python 3.7 App Engine Envinronment as the NDB client library does for using Cloud Datastore with Python 2.7 App Engine.


import firestore_model
from google.firestore import firestore
from filestore_model import Model, Query

# initialize the database connection globally for Firestore Model 
firestore_model.db = firestore.Client()

# Define a data structure for a User
class User(Model):

# Create a new user, pass save = True to automagically save the model object
u1 = User.make(
    occupation='circus dog'

# Fetch all users that match a given query
users = User.query([
    ('occupation', 'circus dog'), 
    ('created', '>', 1540776978)

# Iterate through the results of the query
for u in users:
  print(, u.created, u.first_name, u.last_name, u.occupation)

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
firestore_model-0.0.4-py3-none-any.whl (16.1 kB) Copy SHA256 hash SHA256 Wheel py3
firestore_model-0.0.4.tar.gz (3.5 kB) Copy SHA256 hash SHA256 Source None

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page