Iterate and count entities from google cloud datastore
# Imports the Google Cloud client library
from google.cloud import datastore
# Instantiates a client
client = datastore.Client(project='PROJECT')
query = client.query(kind='KIND')
query_iter = query.fetch()
total = sum(1 for _ in query_iter)