Python 2.7 has reached end of support
and will be deprecated
on January 31, 2026. After deprecation, you won't be able to deploy Python 2.7
applications, even if your organization previously used an organization policy to
re-enable deployments of legacy runtimes. Your existing Python
2.7 applications will continue to run and receive traffic after their deprecation date
. We recommend that
you migrate to the latest supported version of Python
.
Stay organized with collections
Save and categorize content based on your preferences.
google.appengine.api.conf module
Summary
A library for managing flags-like configuration that update dynamically.
Contents
- 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.
- ah__conf__load_from_yaml(parsed_config) source
-
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.
Parameters parse_config – A YAMLConfiguration.
- ah__conf__version
-
An integer property.
- classmethod
kind() source
-
Override the kind name to prevent collisions with users.
- google.appengine.api.conf.LoadSingleConf(stream) source
-
Load a conf.yaml file or string and return a YAMLConfiguration object.
Parameters stream – a file object corresponding to a conf.yaml file, or its contents
as a string.
Returns 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:
Parameters
- 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.
Parameters
Returns The string value of the configuration parameter.
- google.appengine.api.conf.get_all() source
-
Return an object with an attribute for each conf parameter.
Returns An object with an attribute for each conf parameter.
- google.appengine.api.conf.refresh() source
-
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.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License
, and code samples are licensed under the Apache 2.0 License
. For details, see the Google Developers Site Policies
. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-06-16 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-06-16 UTC."],[[["\u003cp\u003eThe \u003ccode\u003egoogle.appengine.api.conf\u003c/code\u003e module provides a way to manage dynamically updating configuration parameters.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eConfig\u003c/code\u003e class represents a configuration in the datastore and memcache, and it loads parameters from a YAML configuration.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eLoadSingleConf\u003c/code\u003e function is used to load a \u003ccode\u003econf.yaml\u003c/code\u003e file or string into a \u003ccode\u003eYAMLConfiguration\u003c/code\u003e object.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eget\u003c/code\u003e function retrieves the value of a specified configuration parameter, ensuring consistent values throughout a single request.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003erefresh\u003c/code\u003e function allows updating the local configuration cache from memcache/datastore, useful for long-running requests or when the freshest data is needed.\u003c/p\u003e\n"]]],[],null,["# google.appengine.api.conf module\n================================\n\nSummary\n-------\n\nA library for managing flags-like configuration that update dynamically.\n\nContents\n--------\n\n*class* google.appengine.api.conf.Config(parent=None, key_name=None, _app=None, \\*\\*kwds)[source](/appengine/docs/legacy/standard/python/refdocs/modules/google/appengine/api/conf#Config)\n\n: Bases: [google.appengine.ext.db.Expando](/appengine/docs/legacy/standard/python/refdocs/google.appengine.ext.db#google.appengine.ext.db.Expando)\n\n The representation of a config in the datastore and memcache. \n\n ah__conf__load_from_yaml(parsed_config)[source](/appengine/docs/legacy/standard/python/refdocs/modules/google/appengine/api/conf#Config.ah__conf__load_from_yaml)\n\n : Loads all the params from a YAMLConfiguration into expando fields.\n\n We set these expando properties with a special name prefix 'p_' to\n keep them separate from the static attributes of Config. That way we\n don't have to check elsewhere to make sure the user doesn't stomp on\n our built in properties.\n Parameters\n\n parse_config -- A YAMLConfiguration. \n\n ah__conf__version\n\n : An integer property.\n\n *classmethod* kind()[source](/appengine/docs/legacy/standard/python/refdocs/modules/google/appengine/api/conf#Config.kind)\n\n : Override the kind name to prevent collisions with users.\n\ngoogle.appengine.api.conf.LoadSingleConf(stream)[source](/appengine/docs/legacy/standard/python/refdocs/modules/google/appengine/api/conf#LoadSingleConf)\n\n: Load a conf.yaml file or string and return a YAMLConfiguration object.\n\n Parameters\n\n stream -- a file object corresponding to a conf.yaml file, or its contents\n as a string.\n Returns\n\nA YAMLConfiguration instance \n\n*class* google.appengine.api.conf.YAMLConfiguration(\\*\\*attributes)[source](/appengine/docs/legacy/standard/python/refdocs/modules/google/appengine/api/conf#YAMLConfiguration)\n\n: Bases: [google.appengine.api.validation.Validated](/appengine/docs/legacy/standard/python/refdocs/google.appengine.api.validation#google.appengine.api.validation.Validated)\n\n This class describes the structure of a conf.yaml file.\n\n At the top level the file should have a params attribue which is a mapping\n from strings to scalars. For example:\n Parameters\n\n - background_color -- 'red'\n\n - message_size -- 1024\n\n - boolean_valued_param -- true\n\n ATTRIBUTES*= {'parameters': \\\u003cclass 'google.appengine.api.conf._ParameterDict'\\\u003e}*\n: \n\ngoogle.appengine.api.conf.get(name, default=None)[source](/appengine/docs/legacy/standard/python/refdocs/modules/google/appengine/api/conf#get)\n\n: Get the value of a configuration parameter.\n\n This function is guaranteed to return the same value for every call\n during a single request.\n Parameters\n\n - name -- The name of the configuration parameter you want a value for.\n\n - default -- A default value to return if the named parameter doesn't exist.\n\n Returns\n\nThe string value of the configuration parameter. \n\ngoogle.appengine.api.conf.get_all()[source](/appengine/docs/legacy/standard/python/refdocs/modules/google/appengine/api/conf#get_all)\n\n: Return an object with an attribute for each conf parameter.\n\n Returns\n\nAn object with an attribute for each conf parameter. \n\ngoogle.appengine.api.conf.refresh()[source](/appengine/docs/legacy/standard/python/refdocs/modules/google/appengine/api/conf#refresh)\n\n: Update the local config cache from memcache/datastore.\n\n Normally configuration parameters are only refreshed at the start of a\n new request. If you have a very long running request, or you just need\n the freshest data for some reason, you can call this function to force\n a refresh."]]