google-cloud-ndb
NDB library for Google Cloud Datastore
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-ndbuv
uv add google-cloud-ndbpoetry
poetry add google-cloud-ndbInstalling 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
Tags
More Internet packages
Botocore provides low-level, data-driven access…
permissive · top 100 on PyPI
aiobotocoreProvides an async client for AWS services using…
permissive · top 100 on PyPI
pydanticPydantic validates Python data structures…
permissive · top 100 on PyPI
filelockProvides a platform-independent file locking…
permissive · top 100 on PyPI
fastapiFastAPI is a Python web framework for building…
permissive · top 100 on PyPI
googleapis-common-protosProvides common Protocol Buffer message…
permissive · top 100 on PyPI
appengine-python-standardProvides access to Google App Engine services…
permissive · top 5,000 on PyPI
google-cloud-datastorePython client library for Google Cloud…
permissive · top 5,000 on PyPI
google-cloud-redisProvides a Python client library for creating,…
permissive · top 1,000 on PyPI
types-google-cloud-ndbProvides type stubs for google-cloud-ndb,…
permissive · top 15,000 on PyPI
google-cloud-redis-clusterPython client library for creating and managing…
permissive · top 15,000 on PyPI
google-cloud-memcacheA Python client library for creating and…
permissive · top 1,000 on PyPI
gcloudProvides Python client libraries for Google…
permissive · top 15,000 on PyPI
google-cloud-dnsPython client library for Google Cloud DNS API…
permissive · top 15,000 on PyPI
google-cloud-languagePython client library for Google Cloud Natural…
permissive · top 1,000 on PyPI
google-cloud-filestorePython client library for creating and managing…
permissive · top 15,000 on PyPI