NDB equivalent for db.class_for_kind

· Tech · No AI

During DB to NDB migration on Google App Engine I’ve got stuck on the problem how to replace db.class_for_kind method. After some research I’ve found (where is it in the documentation? ;-)) that I can use ndb.Model._kind_map. This store all NDB models and I can simply get any model by kind as string, example:

ndb.Model._kind_map.get('Users')
uptime
8,233 days · since 2004
posts
294 · busiest 2026 (64)
words
~143,065 · ~10 h read
topics
tech 239 · personal 55
langs
en 229 · pl 65
written
211 by hand · 83 AI-assisted
projects
3
build
ed6e135 · 2026-07-17