GeneratorDesc

class hugr.envelope.GeneratorDesc(name: str, version: Version | None)[source]

Bases: object

Description of the generator that defined the HUGR module.

These are stored at the module root node metadata under the hugr.metadata.HugrGenerator entry.

Methods

from_json

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

to_json

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

Attributes

name

version

classmethod from_json(value: Any) GeneratorDesc[source]

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

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

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