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.dispatchinfo module
Summary
Dispatch configuration tools.
Library for parsing dispatch.yaml files and working with these in memory.
Contents
- class google.appengine.api.dispatchinfo.DispatchEntry(**attributes)source
-
Bases: google.appengine.api.validation.Validated
A Dispatch entry describes a mapping from a URL pattern to a module.
- ATTRIBUTES = {u'url': <google.appengine.api.dispatchinfo.DispatchEntryURLValidator object>, u'service': <google.appengine.api.validation.Optional object>, u'module': <google.appengine.api.validation.Optional object>}
- class google.appengine.api.dispatchinfo.DispatchEntryURLValidator(default=None)source
-
Bases: google.appengine.api.validation.Validator
Validater for URL patterns.
- Validate(value, unused_key=None)source
-
Validates an URL pattern.
- class google.appengine.api.dispatchinfo.DispatchInfoExternal(**attributes)source
-
Bases: google.appengine.api.validation.Validated
Describes the format of a dispatch.yaml file.
- ATTRIBUTES = {u'application': <google.appengine.api.validation.Optional object>, u'dispatch': <google.appengine.api.validation.Optional object>}
- exception google.appengine.api.dispatchinfo.Errorsource
-
Bases: exceptions.Exception
Base class for errors in this module.
- google.appengine.api.dispatchinfo.LoadSingleDispatch(dispatch_info, open_fn=None)source
Load a dispatch.yaml file or string and return a DispatchInfoExternal.
Parameters
-
dispatch_info – The contents of a dispatch.yaml file as a string, or an open
file object.
-
open_fn – Function for opening files. Unused here, needed to provide
a polymorphic API used by appcfg.py yaml parsing.
Returns
- A DispatchInfoExternal instance which represents the contents of the parsed
-
yaml file.
Raises
- class google.appengine.api.dispatchinfo.ParsedURL(url_pattern)source
-
Bases: object
Dispath Entry URL holder class.
- host_pattern
-
The host pattern component of the URL pattern.
- host_exact
-
True if the host pattern does not start with a *.
- host
-
host_pattern with any leading * removed.
- path_pattern
-
The path pattern component of the URL pattern.
- path_exact
-
True if the path_pattern does not end with a *.
- path
-
path_pattern with any trailing * removed.
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\u003eThis module provides tools for parsing and managing dispatch configurations, specifically \u003ccode\u003edispatch.yaml\u003c/code\u003e files, within the Google App Engine environment.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eDispatchEntry\u003c/code\u003e class defines a mapping between a URL pattern and a corresponding service or module within the application.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eDispatchInfoExternal\u003c/code\u003e represents the structure of a \u003ccode\u003edispatch.yaml\u003c/code\u003e file, including application details and the dispatch rules contained therein.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eDispatchEntryURLValidator\u003c/code\u003e class is responsible for ensuring that URL patterns defined in dispatch configurations are valid and correctly formatted.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eLoadSingleDispatch\u003c/code\u003e function is used to load and parse a \u003ccode\u003edispatch.yaml\u003c/code\u003e file or string, returning a \u003ccode\u003eDispatchInfoExternal\u003c/code\u003e instance that reflects the content.\u003c/p\u003e\n"]]],[],null,["# google.appengine.api.dispatchinfo module\n========================================\n\nSummary\n-------\n\nDispatch configuration tools.\n\nLibrary for parsing dispatch.yaml files and working with these in memory.\n\nContents\n--------\n\n*class* google.appengine.api.dispatchinfo.DispatchEntry(\\*\\*attributes)[source](/appengine/docs/legacy/standard/python/refdocs/modules/google/appengine/api/dispatchinfo#DispatchEntry)\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 A Dispatch entry describes a mapping from a URL pattern to a module. \n\n ATTRIBUTES*= {u'url': \\\u003cgoogle.appengine.api.dispatchinfo.DispatchEntryURLValidator object\\\u003e, u'service': \\\u003cgoogle.appengine.api.validation.Optional object\\\u003e, u'module': \\\u003cgoogle.appengine.api.validation.Optional object\\\u003e}*\n: \n\n*class* google.appengine.api.dispatchinfo.DispatchEntryURLValidator(default=None)[source](/appengine/docs/legacy/standard/python/refdocs/modules/google/appengine/api/dispatchinfo#DispatchEntryURLValidator)\n\n: Bases: [google.appengine.api.validation.Validator](/appengine/docs/legacy/standard/python/refdocs/google.appengine.api.validation#google.appengine.api.validation.Validator)\n\n Validater for URL patterns. \n\n Validate(value, unused_key=None)[source](/appengine/docs/legacy/standard/python/refdocs/modules/google/appengine/api/dispatchinfo#DispatchEntryURLValidator.Validate)\n\n : Validates an URL pattern.\n\n*class* google.appengine.api.dispatchinfo.DispatchInfoExternal(\\*\\*attributes)[source](/appengine/docs/legacy/standard/python/refdocs/modules/google/appengine/api/dispatchinfo#DispatchInfoExternal)\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 Describes the format of a dispatch.yaml file. \n\n ATTRIBUTES*= {u'application': \\\u003cgoogle.appengine.api.validation.Optional object\\\u003e, u'dispatch': \\\u003cgoogle.appengine.api.validation.Optional object\\\u003e}*\n: \n\n*exception* google.appengine.api.dispatchinfo.Error[source](/appengine/docs/legacy/standard/python/refdocs/modules/google/appengine/api/dispatchinfo#Error)\n\n: Bases: exceptions.Exception\n\nBase class for errors in this module. \n\ngoogle.appengine.api.dispatchinfo.LoadSingleDispatch(dispatch_info, open_fn=None)[source](/appengine/docs/legacy/standard/python/refdocs/modules/google/appengine/api/dispatchinfo#LoadSingleDispatch)\n\n: Load a dispatch.yaml file or string and return a DispatchInfoExternal.\n\n Parameters\n\n - dispatch_info -- The contents of a dispatch.yaml file as a string, or an open\n file object.\n\n - open_fn -- Function for opening files. Unused here, needed to provide\n a polymorphic API used by appcfg.py yaml parsing.\n\n Returns\n\n\n A DispatchInfoExternal instance which represents the contents of the parsed\n\n : yaml file.\n\n \u003cbr /\u003e\n\n Raises\n\n - [MalformedDispatchConfigurationError](#google.appengine.api.dispatchinfo.MalformedDispatchConfigurationError) -- The yaml file contains multiple\n dispatch sections or is missing a required value.\n\n - yaml_errors.EventError -- An error occured while parsing the yaml file.\n\n*exception* google.appengine.api.dispatchinfo.MalformedDispatchConfigurationError[source](/appengine/docs/legacy/standard/python/refdocs/modules/google/appengine/api/dispatchinfo#MalformedDispatchConfigurationError)\n\n: Bases: [google.appengine.api.dispatchinfo.Error](#google.appengine.api.dispatchinfo.Error)\n\nConfiguration file for dispatch is malformed. \n\n*class* google.appengine.api.dispatchinfo.ParsedURL(url_pattern)[source](/appengine/docs/legacy/standard/python/refdocs/modules/google/appengine/api/dispatchinfo#ParsedURL)\n\n: Bases: object\n\n Dispath Entry URL holder class. \n\n host_pattern\n\n : The host pattern component of the URL pattern.\n\n host_exact\n\n : True if the host pattern does not start with a \\*.\n\n host\n\n : host_pattern with any leading \\* removed.\n\n path_pattern\n\n : The path pattern component of the URL pattern.\n\n path_exact\n\n : True if the path_pattern does not end with a \\*.\n\n path\n\n : path_pattern with any trailing \\* removed."]]