Parser#

This module exposes the actual parsing functions. If you are creating an implementation, this is what you will actually pass a file to and receive back a PyTiled Parser Map or World class depending on what you’re parsing.

pytiled_parser.parse_map#

pytiled_parser.parse_map(file: Path) TiledMap#

Parse the raw Tiled map into a pytiled_parser type

Parameters:

file – Path to the map file

Returns:

A parsed and typed TiledMap

Return type:

TiledMap

pytiled_parser.parse_world#

pytiled_parser.parse_world(file: Path) World#

Parse the raw world file into a pytiled_parser type

Parameters:

file – Path to the world file

Returns:

A parsed and typed World

Return type:

World