Package#

class hugr.package.Package(modules: list[Hugr], extensions: list[Extension] = <factory>)[source]#

Bases: object

A package of HUGR modules and extensions.

The HUGRs may refer to the included extensions or those not included.

Methods

from_json

Deserialize a JSON string to a Package object.

to_json

Attributes

modules

HUGR modules in the package.

extensions

Extensions included in the package.

extensions: list[Extension]#

Extensions included in the package.

classmethod from_json(json_str: str) Package[source]#

Deserialize a JSON string to a Package object.

Parameters:

json_str – The JSON string representing a Package.

Returns:

The deserialized Package object.

modules: list[Hugr]#

HUGR modules in the package.