Types#

This page is fairly short, but deserves to be shown.

This explains you the specific types available in Fabricius. They are widely used inside Fabricius in order to simply how the docs is rendered and to facilitate understanding of the library.

Fabricius types

fabricius.types.Data: TypeAlias = 'dict[str, typing.Any]'#

Data is an alias that represents a dictionary of which every keys are string and their values of any types.

fabricius.types.PathStrOrPath: TypeAlias = 'str | os.PathLike[str] | pathlib.Path'#

PathStrOrPath represents a path as a str or a pathlib.Path object. Used to help users either have an easy way to give their path.

class fabricius.types.FileCommitResult#

A FileCommitResult is returned when a file was successfully saved. It returns its information after its creation.

name: str#

The name of the file.

state: Literal['pending', 'persisted']#

The state of the file. Should always be “persisted”.

destination: Path#

Where the file is located/has been saved.

data: dict[str, Any]#

The data that has been passed during rendering.

template_content: str#

The original content of the template.

content: str#

The resulting content of the saved file.

fake: bool#

If the file was faked. If faked, the file has not been saved to the disk.