skillfed

google-cloud-ndb

NDB library for Google Cloud Datastore

google-cloud-ndb v2.5.1 492.7K downloads/30d#6,358 on PyPI5,373
Permissive license Apache 2.0 Active released

What it is and what it does

NDB is Google's updated Python 3 client library for Cloud Datastore, replacing the legacy Python 2 App Engine version. It provides an object-relational mapping layer that lets you define data models as Python classes and persist them to Datastore with minimal boilerplate. The library handles serialization, querying, and entity lifecycle management, and integrates optional caching through memcache or Redis to reduce Datastore read costs.

The package is designed for App Engine Python 3 runtime but runs on any Python platform. It depends on google-api-core for transport, google-cloud-datastore for low-level Datastore operations, protobuf for serialization, and optional caching backends. It requires Python 3.10 or later and is actively maintained with no known security vulnerabilities.

Use it for:

  • Build App Engine applications that need persistent entity storage with automatic caching and query support.
  • Store and retrieve structured data in Cloud Datastore from Python services without writing raw API calls.
  • Add caching layers to Datastore queries using memcache or Redis to reduce latency and costs.
  • Migrate from legacy Python 2 App Engine ndb code to modern Python 3 with minimal API changes.
  • Define strongly-typed data models with validation and relationships in a serverless environment.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

NDB is a Python 3 client library for Google Cloud Datastore that provides an object-oriented interface for storing and querying data in Datastore, with support for caching via memcache or Redis.

Yes. NDB is a production-ready, actively maintained library from Google with no known vulnerabilities, low install friction, and permissive licensing. Install it if you are building on App Engine Python 3 or need a Python ORM for Cloud Datastore; skip it if you prefer raw Datastore API calls or use a different database.

Install

google-cloud-ndb on PyPI

pip

pip install google-cloud-ndb

uv

uv add google-cloud-ndb

poetry

poetry add google-cloud-ndb

Installing google-cloud-ndb

Before you install

Low friction installation as a pure Python wheel. Actively maintained with a recent release and no known vulnerabilities. Depends on six Google Cloud libraries and caching backends (pymemcache, redis), all of which are stable.

License in practice

Licensed under Apache 2.0 (permissive), allowing free use, modification, and distribution in commercial and private projects with minimal restrictions.

Quickstart

pip install google-cloud-ndb

from google.cloud import ndb

client = ndb.Client()
with client.context():
    entity = ndb.Model()
    entity.put()

Requires Python >= 3.10. Datastore credentials must be configured via GOOGLE_APPLICATION_CREDENTIALS environment variable or Application Default Credentials.

Verify before relying

  • Whether the package includes query optimization or automatic index management features beyond basic ORM operations.
  • Support for transaction isolation levels or multi-entity ACID guarantees in Datastore.
  • Performance characteristics when used with large result sets or complex nested entity structures.

Package facts

License Apache 2.0 (permissive)
Python support supports the current Python release (>=3.10)
Install friction low — pure-Python wheel
Runtime dependencies 6 — google-api-core, google-cloud-datastore, protobuf, pymemcache, pytz, redis
Maintenance actively maintained — 8 days since the last release
Last repo commit
First released
Downloads 492,745/month — #6,358 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: google_cloud_ndb-2.5.1-py3-none-any.whl

Development Status :: 5 - Production/StableIntended Audience :: DevelopersLicense :: OSI Approved :: Apache Software LicenseOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Topic :: Internet

Tags

google cloud datastore python clientndb datastore ormapp engine datastore librarycloud datastore object mappingdatastore entity persistence pythongoogle cloud ndb cachedatastore query builder
google-cloudormdatastore

More Internet packages

botocore

Botocore provides low-level, data-driven access…

permissive · top 100 on PyPI

aiobotocore

Provides an async client for AWS services using…

permissive · top 100 on PyPI

pydantic

Pydantic validates Python data structures…

permissive · top 100 on PyPI

filelock

Provides a platform-independent file locking…

permissive · top 100 on PyPI

fastapi

FastAPI is a Python web framework for building…

permissive · top 100 on PyPI

googleapis-common-protos

Provides common Protocol Buffer message…

permissive · top 100 on PyPI

appengine-python-standard

Provides access to Google App Engine services…

permissive · top 5,000 on PyPI

google-cloud-datastore

Python client library for Google Cloud…

permissive · top 5,000 on PyPI

google-cloud-redis

Provides a Python client library for creating,…

permissive · top 1,000 on PyPI

types-google-cloud-ndb

Provides type stubs for google-cloud-ndb,…

permissive · top 15,000 on PyPI

google-cloud-redis-cluster

Python client library for creating and managing…

permissive · top 15,000 on PyPI

google-cloud-memcache

A Python client library for creating and…

permissive · top 1,000 on PyPI

gcloud

Provides Python client libraries for Google…

permissive · top 15,000 on PyPI

google-cloud-dns

Python client library for Google Cloud DNS API…

permissive · top 15,000 on PyPI

google-cloud-language

Python client library for Google Cloud Natural…

permissive · top 1,000 on PyPI

google-cloud-filestore

Python client library for creating and managing…

permissive · top 15,000 on PyPI