override_dictionary
¶
apply_overrides_to_dictionary(dictionary, overrides)
¶
Apply multiple CLI overrides to dictionary.
Why
Users need to test configuration changes without editing YAML files. Batching overrides ensures all modifications happen before validation, preventing partial invalid states.
Example
Parameters:
-
dictionary(dict) –Source dictionary to modify.
-
overrides(dict[str, str]) –Map of dotted paths to new values.
Returns:
-
dict–Deep copy with all overrides applied.
Source code in src/rendercv/schema/override_dictionary.py
update_value_by_location(dict_or_list, key, value, full_key)
¶
Navigate nested structure via dotted path and update value.
Why
CLI overrides like --cv.sections.education.0.institution MIT
must modify deeply nested YAML values without requiring users
to edit files. Recursive traversal handles arbitrary nesting
with proper index validation and error context.
Example
Parameters:
-
dict_or_list(dict | list) –Target structure to modify.
-
key(str) –Remaining path segments to traverse.
-
value(str) –Replacement value.
-
full_key(str) –Original full path for error messages.
Returns:
-
dict | list–Modified structure.