Notice: Over the next few months, we're reorganizing the App Engine documentation site to make it easier to find content and better align with the rest of Google Cloud products. The same content will be available, but the navigation will now match the rest of the Cloud products.

Python 3.10 is now generally available.


Class for "vanilla" runtime configuration.

Inherits From: ValidatedDict, ValidatedBase, expected_type

Fields used vary by runtime, so validation is delegated to the per-runtime build processes.

These are intended to be used during Dockerfile generation, not after VM boot.

**kwds keyword arguments will be validated and put into the dict.



View source

Checks for missing or conflicting attributes.

Subclasses should override this function and raise an exception for any errors. Always run this method when all assignments are complete.

ValidationError When there are missing or conflicting attributes.


View source

Check the key for validity and return a corresponding value validator.

key The key that will correspond to the validator we are returning.


View source

Return all the warnings we've got, along with their associated fields.

A list of tuples of (dotted_field, warning), both strings.


Regular expression validator.

Regular expression validator always converts value to string. Note that matches must be exact. Partial matches will not validate. For example:

class ClassDescr(Validated): ATTRIBUTES = { 'name': Regex(r'[a-zA-Z_][a-zA-Z_0-9]*'), 'parent': Type(type)` }

Alternatively, any attribute that is defined as a string is automatically interpreted to be of type Regex. It is possible to specify unicode regex strings as well. This approach is slightly less efficient, but usually is not significant unless parsing large amounts of data:

  class ClassDescr(Validated):
    ATTRIBUTES = { 'name': r'[a-zA-Z_][a-zA-Z_0-9]*',
                   'parent': Type(type),

  # This will raise a ValidationError exception.
  my_class(name='AName with space', parent=AnotherClass)


View source

Set a single value on Validated instance.

This method checks that a given key and value are valid and if so puts the item into this dictionary.

key The name of the attributes.
value The value to set.

ValidationError When no validated attribute exists on class.


View source

Set multiple values on Validated instance.

All attributes will be validated before being set.

attributes A dict of attributes/items to set.

ValidationError When no validated attribute exists on class.


View source

Convert ValidatedBase object to a dictionary.

Recursively traverses all of its elements and converts everything to simplified collections.

Subclasses should override this method.

A dictionary mapping all attributes to simple values or collections.


View source

Print validated object as simplified YAML.

Object as a simplified YAML string compatible with parsing using the SafeLoader.


D.clear() -> None. Remove all items from D.


D.copy() -> a shallow copy of D


Create a new dictionary with keys from iterable and values set to value.


Return the value for key if key is in the dictionary, else default.


D.items() -> a set-like object providing a view on D's items


D.keys() -> a set-like object providing a view on D's keys


D.pop(k[,d]) -> v, remove specified key and return the corresponding value.

If key is not found, default is returned if given, otherwise KeyError is raised


Remove and return a (key, value) pair as a 2-tuple.

Pairs are returned in LIFO (last-in, first-out) order. Raises KeyError if the dict is empty.


View source

Trap setdefaultss to ensure all key/value pairs are valid.

See the documentation for setdefault on dict for usage details.

ValidationError if the specified key is illegal or the value invalid.


View source

Trap updates to ensure all key/value pairs are valid.

See the documentation for update on dict for usage details.

ValidationError if any of the specified keys are illegal or values invalid.


D.values() -> an object providing a view on D's values


True if the dictionary has the specified key, else False.


Return self==value.


Return self>=value.


x.getitem(y) <==> x[y]


Return self>value.


Implement iter(self).


Return self<=value.


Return len(self).


Return self<value.


Return self!=value.


Return self|value.


Return value|self.