Coverage for sygaldry / __init__.py: 86%

12 statements  

« prev     ^ index     » next       coverage.py v7.13.5, created at 2026-04-10 13:02 -0400

1""" 

2Public API for Sygaldry. 

3""" 

4 

5from __future__ import annotations 

6 

7from pathlib import Path 

8from typing import Any, Optional 

9 

10from .__version__ import __version__ 

11from .artificery import Artificery, resolve_config 

12from .cache import Instances 

13 

14__author__ = "Rohan B. Dalton" 

15__all__ = ( 

16 "Artificery", 

17 "load", 

18) 

19 

20 

21def load( 

22 path: str | Path, 

23 *, 

24 cache: Instances | None = None, 

25 transient: bool = False, 

26) -> dict[str, Any]: 

27 """ 

28 Load, interpolate, and resolve a config file. 

29 

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

31 :param cache: Optional instance cache. 

32 :param transient: If True, bypass caching. 

33 :type path: str | pathlib.Path 

34 :type cache: Instances | None 

35 :type transient: bool 

36 :returns: Resolved configuration mapping. 

37 :rtype: dict[str, Any] 

38 """ 

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

40 

41 

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

43 pass