CustomType

class asdf.types.CustomType[source]

Bases: ExtensionType

Base class for all user-defined types.

Attributes Summary

handle_dynamic_subclasses

bool: Indicates whether dynamically generated subclasses can be serialized

has_required_modules

bool: Indicates whether modules specified by requires are available.

name

str or list: The name of the type.

organization

str: The organization responsible for the type.

requires

list: Python packages that are required to instantiate the object.

standard

str: The standard the type is defined in.

supported_versions

set: Versions that explicitly compatible with this extension class.

types

list: List of types that this extension class can convert to/from YAML.

validators

dict: Mapping JSON Schema keywords to validation functions for jsonschema.

version

str, tuple, asdf.versioning.AsdfVersion, or asdf.versioning.AsdfSpec:

yaml_tag

str: The YAML tag to use for the type.

Attributes Documentation

handle_dynamic_subclasses = False

bool: Indicates whether dynamically generated subclasses can be serialized

Flag indicating whether this type is capable of serializing subclasses of any of the types listed in types that are generated dynamically.

has_required_modules = True

bool: Indicates whether modules specified by requires are available.

NOTE: This value is automatically generated. Do not set it in subclasses as it will be overwritten.

name = None

str or list: The name of the type.

organization = 'stsci.edu'

str: The organization responsible for the type.

requires = []

list: Python packages that are required to instantiate the object.

standard = 'asdf'

str: The standard the type is defined in.

supported_versions = []

set: Versions that explicitly compatible with this extension class.

If provided, indicates explicit compatibility with the given set of versions. Other versions of the same schema that are not included in this set will not be converted to custom types with this class.

types = []

list: List of types that this extension class can convert to/from YAML.

Custom Python types that, when found in the tree, will be converted into basic types for YAML output. Can be either strings referring to the types or the types themselves.

validators = {}

dict: Mapping JSON Schema keywords to validation functions for jsonschema.

Useful if the type defines extra types of validation that can be performed.

version = AsdfVersion('1.0.0')
str, tuple, asdf.versioning.AsdfVersion, or asdf.versioning.AsdfSpec:

The version of the type.

yaml_tag = None

str: The YAML tag to use for the type.

If not provided, it will be automatically generated from name, organization, standard and version.