Rendering API¶
render
¶
Render selected services without discarding handwritten source comments.
RenderError
¶
Bases: RuntimeError
Raised when generation or Compose validation fails.
render_header
¶
render_header(plan: StackPlan) -> str
Render the established header and selected-service manifest.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
plan
|
StackPlan
|
Resolved stack plan supplying summary text and service order. |
required |
Returns:
| Type | Description |
|---|---|
str
|
Commented Compose header ending with one blank line. |
Source code in docker/src/maraudarr/render.py
render_compose
¶
Render the complete comment-rich Compose file.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
catalog
|
Catalog
|
Validated source catalog containing templates and charts. |
required |
plan
|
StackPlan
|
Resolved service selection in deterministic output order. |
required |
Returns:
| Type | Description |
|---|---|
str
|
A single Compose document with unresolved environment variables and |
str
|
project-owned comments preserved. |
Raises:
| Type | Description |
|---|---|
TemplateError
|
If an owned Compose source no longer contains an expected service, foundation, footer, or comment group. |
OSError
|
If a required source file cannot be read. |
Source code in docker/src/maraudarr/render.py
render_environment
¶
render_environment(
catalog: Catalog,
plan: StackPlan,
existing_path: Path | None,
generate_secrets: bool = True,
) -> str
Render the selected environment while preserving user-managed values.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
catalog
|
Catalog
|
Validated catalog containing environment source fragments. |
required |
plan
|
StackPlan
|
Resolved service selection in deterministic output order. |
required |
existing_path
|
Path | None
|
Existing |
required |
generate_secrets
|
bool
|
Whether known first-run placeholders should receive cryptographically strong generated values. |
True
|
Returns:
| Type | Description |
|---|---|
str
|
The complete environment document with a trailing newline. |
Raises:
| Type | Description |
|---|---|
OSError
|
If a source or existing environment file cannot be read. |
Source code in docker/src/maraudarr/render.py
render_homepage_services
¶
Render Homepage groups and cards for selected integrations.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
catalog
|
Catalog
|
Validated catalog used to locate Homepage source fragments. |
required |
plan
|
StackPlan
|
Resolved service selection controlling cards and calendar items. |
required |
Returns:
| Type | Description |
|---|---|
str
|
A complete Homepage |
Raises:
| Type | Description |
|---|---|
RenderError
|
If a required built-in card cannot be found. |
OSError
|
If a Homepage source fragment cannot be read. |
Source code in docker/src/maraudarr/render.py
write_config
¶
Create selected config directories without replacing application state.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
catalog
|
Catalog
|
Validated catalog containing shared and service config seeds. |
required |
plan
|
StackPlan
|
Resolved service selection controlling generated directories. |
required |
output_dir
|
Path
|
Plundarr project directory that owns |
required |
Returns:
| Type | Description |
|---|---|
Path
|
Path to the generated or updated config root. |
Raises:
| Type | Description |
|---|---|
RenderError
|
If a required Homepage card cannot be rendered. |
OSError
|
If directories or seed files cannot be created or copied. |
Source code in docker/src/maraudarr/render.py
validate_compose
¶
Ask Docker Compose to validate a generated project pair.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
output_dir
|
Path
|
Directory containing |
required |
Raises:
| Type | Description |
|---|---|
RenderError
|
If an installed Docker Compose command rejects the project. |
Note
A missing Docker executable is tolerated so source-only environments can still render output. Any installed command that returns failure is treated as authoritative.
Source code in docker/src/maraudarr/render.py
write_stack
¶
Generate, validate, and write a complete Plundarr project.
Compose and environment artifacts are staged and validated before their public paths are atomically replaced. Config seeds are applied afterward using preservation rules appropriate for application-owned state.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
catalog
|
Catalog
|
Validated catalog providing templates and service sources. |
required |
plan
|
StackPlan
|
Resolved service selection in deterministic generation order. |
required |
output_dir
|
Path
|
Directory that receives the generated Plundarr project. |
required |
Returns:
| Type | Description |
|---|---|
tuple[Path, Path, Path]
|
Paths to |
Raises:
| Type | Description |
|---|---|
RenderError
|
If rendering requirements or Compose validation fail. |
OSError
|
If staging, writing, or replacing output files fails. |