Skip to content

dlgforge.utils.merge

Dictionary merge and path resolution helpers.

deep_merge(base, override)

Deep merge.

Parameters:

Name Type Description Default
base Dict[str, Any]

Dict[str, Any] value used by this operation.

required
override Dict[str, Any]

Dict[str, Any] value used by this operation.

required

Returns:

Type Description
Dict[str, Any]

Dict[str, Any]: Value produced by this API.

Raises:

Type Description
Exception

Propagates unexpected runtime errors from downstream calls.

Side Effects / I/O: - Primarily performs in-memory transformations.

Preconditions / Invariants: - Callers should provide arguments matching annotated types and expected data contracts.

Examples:

>>> from dlgforge.utils.merge import deep_merge
>>> deep_merge(...)

resolve_path(path, project_root, config_dir=None)

Resolve path from configuration.

Parameters:

Name Type Description Default
path str

Filesystem path used by this operation.

required
project_root Path

Resolved project directory context.

required
config_dir Optional[Path]

Resolved project directory context.

None

Returns:

Type Description
Optional[Path]

Optional[Path]: Resolved value after applying defaults and normalization rules.

Raises:

Type Description
Exception

Propagates unexpected runtime errors from downstream calls.

Side Effects / I/O: - Primarily performs in-memory transformations.

Preconditions / Invariants: - Callers should provide arguments matching annotated types and expected data contracts.

Examples:

>>> from dlgforge.utils.merge import resolve_path
>>> resolve_path(...)