blueprintable

Alias module. Imports Blueprint, BlueprintBook, DeconstructionPlanner, UpgradePlanner, and Group under the namespace draftsman.

get_blueprintable_from_string(
blueprintable_string: str,
) Blueprintable

Gets a Blueprintable object based off of the blueprint_string. A “Blueprintable object” in this context means either a Blueprint, DeconstructionPlanner, UpgradePlanner, or a BlueprintBook, depending on the particular string you passed in. This function allows you generically accept export strings of any of the above types and return the appropriate class instance.

Parameters:
blueprintable_string: str

The blueprint string to interpret.

Returns:

A Blueprint, BlueprintBook, DeconstructionPlanner, or UpgradePlanner object.

Raises:
  • MalformedBlueprintStringError – If the blueprint_string cannot be resolved due to an error with the zlib or JSON decompression.

  • IncorrectBlueprintTypeError – If the root level of the decompressed JSON object is neither "blueprint", "deconstruction_planner", "upgrade_planner", nor "blueprint_book", and thus it’s type cannot be deduced.

get_blueprintable_from_JSON(
blueprintable_JSON: dict,
) Blueprintable

Gets a Blueprintable object based off of the blueprint_JSON. A “Blueprintable object” in this context means either a Blueprint, DeconstructionPlanner, UpgradePlanner, or a BlueprintBook, depending on the particular dict you passed in. This function allows you generically accept any valid JSON structure of the the above types and return the appropriate class instance.

Parameters:
blueprintable_JSON: dict

The blueprint JSON dict to interpret.

Returns:

A Blueprint, BlueprintBook, DeconstructionPlanner, or UpgradePlanner object.

Raises:

IncorrectBlueprintTypeError – If the root level of the decompressed JSON object is neither "blueprint", "deconstruction_planner", "upgrade_planner", nor "blueprint_book", and thus it’s type cannot be deduced.