ExtensionDesc

class hugr.envelope.ExtensionDesc(name: str, version: Version)[source]

Bases: object

High level description of a HUGR extension.

A list of these is stored at the module root node metadata under the hugr.metadata.HugrUsedExtensions entry.

Methods

from_json

Decodes the extension from a native types obtained from json.load.

to_json

Encodes the extension as a dictionary of native types that can be serialized by json.dump.

Attributes

name

version

classmethod from_json(value: Any) ExtensionDesc[source]

Decodes the extension from a native types obtained from json.load.

to_json() dict[str, str][source]

Encodes the extension as a dictionary of native types that can be serialized by json.dump.