ExtensionProxy

class asdf.extension.ExtensionProxy(delegate, package_name=None, package_version=None)[source]

Bases: Extension

Proxy that wraps an extension, provides default implementations of optional methods, and carries additional information on the package that provided the extension.

Attributes Summary

asdf_standard_requirement

Get the extension's ASDF Standard requirement.

class_name

Get the fully qualified class name of the extension.

compressors

Get the extension's compressors.

converters

Get the extension's converters.

delegate

Get the wrapped extension instance.

extension_uri

Get the URI of the extension to the ASDF Standard implemented by this class.

legacy

False

legacy_class_names

Get the set of fully-qualified class names used by older versions of this extension.

package_name

Get the name of the Python package that provided this extension.

package_version

Get the version of the Python package that provided the extension

tag_mapping

Get the legacy extension's tag-to-schema-URI mapping.

tags

Get the YAML tags supported by this extension.

types

Get the legacy extension's ExtensionType subclasses.

url_mapping

Get the legacy extension's schema-URI-to-URL mapping.

validators

Get the asdf.extension.Validator instances for additional schema properties supported by this extension.

yaml_tag_handles

Get a dictionary of custom yaml TAG handles defined by the extension.

Methods Summary

maybe_wrap(delegate)

Attributes Documentation

asdf_standard_requirement

Get the extension’s ASDF Standard requirement.

Returns:
packaging.specifiers.SpecifierSet
class_name

Get the fully qualified class name of the extension.

Returns:
str
compressors

Get the extension’s compressors.

Returns:
list of asdf.extension.Compressor
converters

Get the extension’s converters.

Returns:
list of asdf.extension.Converter
delegate

Get the wrapped extension instance.

Returns:
asdf.extension.Extension
extension_uri

Get the URI of the extension to the ASDF Standard implemented by this class. Note that this may not uniquely identify the class itself.

Returns:
str or None
legacy

False

legacy_class_names

Get the set of fully-qualified class names used by older versions of this extension. This allows a new-style implementation of an extension to prevent warnings when a legacy extension is missing.

Returns:
set of str
package_name

Get the name of the Python package that provided this extension.

Returns:
str or None

None if the extension was added at runtime.

package_version

Get the version of the Python package that provided the extension

Returns:
str or None

None if the extension was added at runtime.

tag_mapping

Get the legacy extension’s tag-to-schema-URI mapping.

Returns:
iterable of tuple or callable
tags

Get the YAML tags supported by this extension.

Returns:
list of asdf.extension.TagDefinition
types

Get the legacy extension’s ExtensionType subclasses.

Returns:
iterable of asdf.type.ExtensionType
url_mapping

Get the legacy extension’s schema-URI-to-URL mapping.

Returns:
iterable of tuple or callable
validators

Get the asdf.extension.Validator instances for additional schema properties supported by this extension.

Returns:
list of asdf.extension.Validator
yaml_tag_handles

Get a dictionary of custom yaml TAG handles defined by the extension.

The dictionary key indicates the TAG handles to be placed in the YAML header, the value defines the string for tag replacement. See https://yaml.org/spec/1.1/#tag%20shorthand/

Example: {"!foo!": "tag:nowhere.org:custom/"}

Returns:
dict

Methods Documentation

classmethod maybe_wrap(delegate)[source]