Collection#

class Collection(title: str = '', author: str = '', created_at: str = '', updated_at: str = '', notes: str = '')#

Collection of one or more game puzzles.

title#

Collection title

Type

str

author#

Collection author

Type

str

created_at#

datetime string of unspecified format (it is not parsed)

Type

str

updated_at#

datetime string of unspecified format (it is not parsed)

Type

str

notes#

collection notes

Type

str

puzzles#

collection puzzles

Type

List[Puzzle]

dump(dst: Union[str, Path, BufferedWriter, TextIOWrapper, FileIO, StringIO, BytesIO])#

Saves collection to dst in SokobanYASC .sok format.

Note

Doesn’t care about file extension if dst is path to file.

Parameters

dst – Path to destination file or destination stream object.

dumps() str#

Saves collection to str.

load(src: Union[str, Path, BufferedReader, TextIOWrapper, FileIO, StringIO, BytesIO], tessellation_hint: Tessellation = Tessellation.SOKOBAN)#

Loads collection from src.

Loader supports SokobanYASC .sok format, but will happily try to load older, similar textual sokoban files (usually with extensions .txt, .tsb or .hsb).

Parameters
  • src – source file path or input stream object

  • tessellation_hint – If puzzles in file don’t specify their game tessellation assume this value.

loads(data: Union[str, bytes], tessellation_hint: Tessellation = Tessellation.SOKOBAN)#

Loads collections from data.

Parameters
  • data – raw collection data

  • tessellation_hint – If puzzles in file don’t specify their game tessellation assume this value.