Skip to content

API Reference

The API reference is rendered from Python source with mkdocstrings.

Package

Main package for se-codeowners.

SurfacesError

Bases: ValueError

Raised when surfaces.toml does not match the expected structure.

load_surfaces(path)

Read path and return a validated :class:SurfacesDoc.

Parameters:

Name Type Description Default
path Path

The path to the surfaces.toml file.

required

Returns:

Name Type Description
SurfacesDoc SurfacesDoc

The loaded and validated surfaces document.

Raises:

Type Description
SurfacesError

If the file cannot be read, is not valid UTF-8, is not valid TOML, or does not conform to the expected structure.

render_codeowners(doc, *, strict=False)

Return CODEOWNERS file content for doc.

Surfaces without an oversight_role are skipped. If strict is set, a handle still containing a placeholder token is treated as an error.

Parameters:

Name Type Description Default
doc SurfacesDoc

The surfaces document to render.

required
strict bool

Whether to treat placeholder handles as errors. Defaults to False.

False