Although poorly documented, there is an introspection API for NDB models; simply use the name of the configuration option with an underscore prefixed:
Contact._properties['name']._required
is the value of the required
option.
The underscores do not signify 'privacy' here but are used to avoid clashing with names from the model itself (e.g. if name
were a StructuredProperty
referencing another model with a required
property you wouldn't otherwise be able to access the required
option).