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

extensions

Get the list of extensions.

Methods Summary

get_converter_for_tag(tag)

Get the converter for the specified tag.

get_converter_for_type(typ)

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.

handles_tag_definition(tag)

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
handles_tag_definition(tag)[source]

Return True if the specified tag has a definition.

Parameters:
tagstr

Tag URI.

Returns:
bool
handles_type(typ)[source]

Returns True if the specified Python type is handled by a converter.

Parameters:
typtype
Returns:
bool