google.appengine.api.conf module


A library for managing flags-like configuration that update dynamically.


class google.appengine.api.conf.Config(parent=None, key_name=None, _app=None, **kwds)source

Bases: google.appengine.ext.db.Expando

The representation of a config in the datastore and memcache.


Loads all the params from a YAMLConfiguration into expando fields.

We set these expando properties with a special name prefix ‘p_’ to keep them separate from the static attributes of Config. That way we don’t have to check elsewhere to make sure the user doesn’t stomp on our built in properties.


parse_config – A YAMLConfiguration.


An integer property.

classmethod kind()source

Override the kind name to prevent collisions with users.


Load a conf.yaml file or string and return a YAMLConfiguration object.


stream – a file object corresponding to a conf.yaml file, or its contents as a string.


A YAMLConfiguration instance

class google.appengine.api.conf.YAMLConfiguration(**attributes)source

Bases: google.appengine.api.validation.Validated

This class describes the structure of a conf.yaml file.

At the top level the file should have a params attribue which is a mapping from strings to scalars. For example:

  • background_color – ‘red’

  • message_size – 1024

  • boolean_valued_param – true

ATTRIBUTES = {'parameters': <class 'google.appengine.api.conf._ParameterDict'>}
google.appengine.api.conf.get(name, default=None)source

Get the value of a configuration parameter.

This function is guaranteed to return the same value for every call during a single request.

  • name – The name of the configuration parameter you want a value for.

  • default – A default value to return if the named parameter doesn’t exist.


The string value of the configuration parameter.


Return an object with an attribute for each conf parameter.


An object with an attribute for each conf parameter.


Update the local config cache from memcache/datastore.

Normally configuration parameters are only refreshed at the start of a new request. If you have a very long running request, or you just need the freshest data for some reason, you can call this function to force a refresh.