Skip to main content

firestore-model

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

Overview

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.

Blog post describing motivation and further usage

Example

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
@dataclass
class User(Model):
  first_name:str
  last_name:str
  occupation:str

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

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

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

Metadata

Release files for firestore-model 0.0.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for firestore-model 0.0.5
File Size Uploaded Provenance Actions
firestore_model-0.0.5.tar.gz 3.6 kB Without provenance Details for firestore_model-0.0.5.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for firestore-model 0.0.5
File Interpreter ABI Platform Actions
firestore_model-0.0.5-py3-none-any.whl Python 3 none any Details for firestore_model-0.0.5-py3-none-any.whl

Total release size: 19.9 kB

Release files / firestore_model-0.0.5.tar.gz

Download URL firestore_model-0.0.5.tar.gz
Size 3.6 kB
Tags Source
SHA-256 checksum
How to use checksums
f4b3b3094347584875e17a946ce0ec00f3e7d893261987c3e928392dc5b34741
BLAKE2b-256 checksum
How to use checksums
99f17f6eeddb70f28b348c47826fcb47c843798664edebb6e2e228c59c5c1423
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.4.2 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.9.1 tqdm/4.28.1 CPython/3.7.1

Release files / firestore_model-0.0.5-py3-none-any.whl

Download URL firestore_model-0.0.5-py3-none-any.whl
Size 16.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
13ad9231997055ff257ef8516c4be559c94d1f4107b8004d45d857112b47c26f
BLAKE2b-256 checksum
How to use checksums
08592d8ae9b1c7714c0fee9dcf3f7b877f8b59b2c534ef53b6a1807ac9d208ba
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.4.2 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.9.1 tqdm/4.28.1 CPython/3.7.1

Security for firestore-model 0.0.5

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page