From Python
The commands are also three calls, with the options by keyword:
import urdido
problems = urdido.check("promo/video.toml") # [] when the declaration passesproject = urdido.load("promo/video.toml", "en") # .decl, .roots, .out, .load()urdido.make("promo/video.toml", "en", plan=True, progress="off") # 0 when it passedurdido.check(path)
Section titled “urdido.check(path)”Returns the list of problems urdido check would print, empty when the declaration
passes.
urdido.load(path, language)
Section titled “urdido.load(path, language)”Returns the loaded project: its declaration (.decl), its roots (.roots), its output
folder (.out), and .load() for the side files.
urdido.make(path, language, **options)
Section titled “urdido.make(path, language, **options)”Builds as urdido build does and returns 0 when it passed. It takes the options
urdido build takes (cut="chapter:2", vertical, revision, …) and refuses an
unknown one by name.
Errors
Section titled “Errors”A refused build raises urdido.UrdidoError, or one of its kinds: Refused,
DeclarationError, MissingTool. The library never exits the process.
Never fill an argparse.Namespace or import urdido.build.Build yourself: those are
internal and change without notice.