load_asn

jwst.associations.load_asn.load_asn(serialized, fmt=None, first=True, validate=True, registry=<class 'jwst.associations.registry.AssociationRegistry'>, **kwargs)[source]

Load an Association from a file or object.

Parameters:
serializedobject

The serialized form of the association.

fmtstr or None

The format to force. If None, try all available.

Deprecated since version 2.1: Only JSON format is supported now.

firstbool

A serialization potentially matches many rules. Only return the first successful load.

validatebool

Validate against the class’s defined schema, if any.

registryAssociationRegistry or None

The association registry to use. If None, no registry is used. Can be passed just a registry class instead of instance.

**kwargs

Other arguments to pass to the load methods defined in the KeyValueRegistry.

Returns:
Association

The loaded association.

Raises:
jwst.associations.exceptions.AssociationNotValidError

Cannot create or validate the association.

Notes

While the serialized object must be in JSON format, the input can be either a string or a file object containing the string.

If no registry is specified, the default load() method is used.