ExtensionManager¶
- class asdf.extension.ExtensionManager(extensions)[source]¶
Bases:
object
Wraps a list of extensions and indexes their converters by tag and by Python type.
- Parameters:
- extensionsiterable of asdf.extension.Extension
List of enabled extensions to manage. Extensions placed earlier in the list take precedence.
Attributes Summary
Get the list of extensions.
Methods Summary
Get the converter for the specified tag.
Get the converter for the specified Python type.
get_tag_definition
(tag)Get the tag definition for the specified tag.
handles_tag
(tag)Return
True
if the specified tag is handled by a converter.Return
True
if the specified tag has a definition.handles_type
(typ)Returns
True
if the specified Python type is handled by a converter.Attributes Documentation
- extensions¶
Get the list of extensions.
- Returns:
- list of asdf.extension.ExtensionProxy
Methods Documentation
- get_converter_for_tag(tag)[source]¶
Get the converter for the specified tag.
- Parameters:
- tagstr
Tag URI.
- Returns:
- asdf.extension.Converter
- Raises:
- KeyError
Unrecognized tag URI.
- get_converter_for_type(typ)[source]¶
Get the converter for the specified Python type.
- Parameters:
- typtype
- Returns:
- asdf.extension.Converter
- Raises:
- KeyError
Unrecognized type.
- get_tag_definition(tag)[source]¶
Get the tag definition for the specified tag.
- Parameters:
- tagstr
Tag URI.
- Returns:
- asdf.extension.TagDefinition
- Raises:
- KeyError
Unrecognized tag URI.
- handles_tag(tag)[source]¶
Return
True
if the specified tag is handled by a converter.- Parameters:
- tagstr
Tag URI.
- Returns:
- bool