Skip to content
urdidourdidoDocs

From Python

The commands are also three calls, with the options by keyword:

import urdido
problems = urdido.check("promo/video.toml") # [] when the declaration passes
project = urdido.load("promo/video.toml", "en") # .decl, .roots, .out, .load()
urdido.make("promo/video.toml", "en", plan=True, progress="off") # 0 when it passed

Returns the list of problems urdido check would print, empty when the declaration passes.

Returns the loaded project: its declaration (.decl), its roots (.roots), its output folder (.out), and .load() for the side files.

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.

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.