astro py:docs

- Index
- Modules

### Navigation

- next »
- « previous |
- asdf v »
- Developer API »
- ExtensionManager

# ExtensionManager

class asdf.extension.ExtensionManager(extensions)

  Bases: `object`

  Wraps a list of extensions and indexes their converters by tag and by Python type.

  Parameters:
    extensions iterable 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.
  `validator_manager` |

  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
  validator_manager

  Methods Documentation

  get_converter_for_tag(tag)

    Get the converter for the specified tag.

    Parameters:
      tag str

        Tag URI.

    Returns:
      asdf.extension.Converter
    Raises:
      KeyError

        Unrecognized tag URI.

  get_converter_for_type(typ)

    Get the converter for the specified Python type.

    Parameters:
      typ type
    Returns:
      asdf.extension.Converter
    Raises:
      KeyError

        Unrecognized type.

  get_tag_definition(tag)

    Get the tag definition for the specified tag.

    Parameters:
      tag str

        Tag URI.

    Returns:
      asdf.extension.TagDefinition
    Raises:
      KeyError

        Unrecognized tag URI.

  handles_tag(tag)

    Return `True` if the specified tag is handled by a converter.

    Parameters:
      tag str

        Tag URI.

    Returns:
      bool
  handles_tag_definition(tag)

    Return `True` if the specified tag has a definition.

    Parameters:
      tag str

        Tag URI.

    Returns:
      bool
  handles_type(typ)

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

    Parameters:
      typ type
    Returns:
      bool