Catalog API¶
catalog
¶
Load Maraudarr's modular service catalog and resolve stack selections.
CatalogError
¶
Bases: ValueError
Report invalid catalog data or an impossible stack request.
Catalog
¶
Provide validated service metadata, presets, and owned source paths.
Attributes:
| Name | Type | Description |
|---|---|---|
root |
Resolved directory containing catalog, template, and service data. |
|
services |
Service metadata keyed by stable catalog identifier. |
|
presets |
Preset metadata keyed by stable preset identifier. |
Load and validate one Maraudarr catalog tree.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
root
|
Path | None
|
Optional catalog root. The environment-aware default is used when this value is absent. |
None
|
Raises:
| Type | Description |
|---|---|
CatalogError
|
If files, dependencies, or preset references are invalid. |
OSError
|
If the catalog cannot be read from disk. |
TOMLDecodeError
|
If |
Source code in docker/src/maraudarr/catalog.py
preset
¶
preset(preset_id: str) -> Preset
Return a named preset.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
preset_id
|
str
|
Stable catalog identifier for the requested preset. |
required |
Returns:
| Type | Description |
|---|---|
Preset
|
The matching immutable preset. |
Raises:
| Type | Description |
|---|---|
CatalogError
|
If the identifier is unknown. The message includes every available preset identifier. |
Source code in docker/src/maraudarr/catalog.py
resolve
¶
resolve(
preset_id: str,
add: set[str] | None = None,
remove: set[str] | None = None,
selected: set[str] | None = None,
) -> StackPlan
Resolve one preset and service selection into a generation plan.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
preset_id
|
str
|
Preset supplying stack identity and core services. |
required |
add
|
set[str] | None
|
Service IDs explicitly added after the starting selection. |
None
|
remove
|
set[str] | None
|
Optional service IDs removed before additions are applied. |
None
|
selected
|
set[str] | None
|
Complete starting selection for interactive or custom flows. Preset defaults are used when this value is absent. |
None
|
Returns:
| Type | Description |
|---|---|
StackPlan
|
An immutable plan containing recursively resolved dependencies in |
StackPlan
|
deterministic catalog order. |
Raises:
| Type | Description |
|---|---|
CatalogError
|
If the preset or a requested service is unknown, or if a custom selection would produce an empty stack. |
Source code in docker/src/maraudarr/catalog.py
source_path
¶
Resolve a path that must remain inside the catalog root.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
relative_path
|
str
|
Catalog-root-relative source path. |
required |
Returns:
| Type | Description |
|---|---|
Path
|
The normalized absolute source path. |
Raises:
| Type | Description |
|---|---|
CatalogError
|
If normalization would escape the owned root. |
Source code in docker/src/maraudarr/catalog.py
config_path
¶
config_path(service: Service) -> Path
Return the optional config seed directory for one service.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
service
|
Service
|
Service whose project-owned config seeds are requested. |
required |
Returns:
| Type | Description |
|---|---|
Path
|
The normalized path beneath |
Raises:
| Type | Description |
|---|---|
CatalogError
|
If the derived source path escapes the catalog root. |
Source code in docker/src/maraudarr/catalog.py
default_catalog_root
¶
Locate Maraudarr assets in either the image or source checkout.
Returns:
| Type | Description |
|---|---|
Path
|
The resolved |
Path
|
otherwise, the package's owning |