gilbert.collection module

class gilbert.collection.Collection(site, default_type=<class 'gilbert.content.Content'>, loaders=None)

Bases: object

Collection of content objects.

items() → Iterator[Tuple[str, gilbert.content.Content]]

Iterates all the items in this Collection.

load(path: pathlib.Path, root: pathlib.Path = None)

Recursively load all objects from a path.

load_file(path: pathlib.Path, name: str) → gilbert.content.Content
matching(query: Union[Query, dict, AstNode, int, float, str]) → Sequence[gilbert.content.Content]

Return objects matching a query

gilbert.collection.load_raw(path: pathlib.Path) → Tuple[Union[None, ByteString, str], Dict[KT, VT]]

For anything we don’t recognise, we load it as a Raw data.