Amulet Core API Reference

amulet.load_level(path)[source]

Load and return a World or Structure class exposing the data at path

Calls load_format() to try and find a FormatWrapper that can open the data.

If one is found it will wrap it with either a World or Structure class and return it.

Parameters

path (str) – The file path to a file or directory for the object to be loaded.

Return type

Union[World, Structure]

Returns

A World or Structure class instance containing the data.

Raises

LoaderNoneMatched: If no loader could be found that can open the data at path.

Exception: Other errors.

amulet.load_format(path)[source]

Find a valid subclass of FormatWrapper and return the data wrapped in the class. This exposes a low level API to read and write the world data.

Inspects the data at the given path to find a valid subclass of FormatWrapper.

If a valid wrapper is found it is set up and returned.

This is not recommended for new users and does not include a history system.

Parameters

path (str) – The file path to a file or directory for the object to be loaded.

Return type

Union[WorldFormatWrapper, StructureFormatWrapper]

Returns

An instance of WorldFormatWrapper or StructureFormatWrapper containing the data at path.

Raises

LoaderNoneMatched: If no loader could be found that can open the data at path.

Exception: Other errors.