tiled.client.simple#

tiled.client.simple(directory: str | Path | None = None, api_key: str | None = None, port: int = 0, readable_storage: str | Path | None = None, quiet: bool = False)[source]#

Spawn a Tiled server on a background thread and connect to it.

This is intended to be used for tutorials and development. It employs only basic security and should not be used to store anything important. It does not scale to large number of users. By default, it uses temporary storage.

Parameters:
directoryOptional[Path, str]

Location where data, including files and embedded databases, will be stored. By default, a temporary directory will be used.

api_keyOptional[str]

By default, an 8-bit random secret is generated. (Production Tiled servers use longer secrets.)

portOptional[int]

Port the server will listen on. By default, a random free high port is allocated by the operating system.

quietbool

Suppress printing the server URL. False by default.