Coverage for sygaldry / __init__.py: 85%

11 statements  

« prev     ^ index     » next       coverage.py v7.13.5, created at 2026-03-31 23:33 -0400

1""" 

2Public API for Sygaldry. 

3""" 

4 

5from __future__ import annotations 

6 

7from pathlib import Path 

8from typing import Any, Optional 

9 

10from .artificery import Artificery, resolve_config 

11from .cache import Instances 

12 

13__author__ = "Rohan B. Dalton" 

14__all__ = ( 

15 "Artificery", 

16 "load", 

17) 

18 

19 

20def load( 

21 path: str | Path, 

22 *, 

23 cache: Instances | None = None, 

24 transient: bool = False, 

25) -> dict[str, Any]: 

26 """ 

27 Load, interpolate, and resolve a config file. 

28 

29 :param path: Path to a YAML or TOML config file. 

30 :param cache: Optional instance cache. 

31 :param transient: If True, bypass caching. 

32 :type path: str | pathlib.Path 

33 :type cache: Instances | None 

34 :type transient: bool 

35 :returns: Resolved configuration mapping. 

36 :rtype: dict[str, Any] 

37 """ 

38 return Artificery(path, cache=cache, transient=transient).resolve() 

39 

40 

41if __name__ == "__main__": 41 ↛ 42line 41 didn't jump to line 42 because the condition on line 41 was never true

42 pass