series_bindings.upsert_series_binding()
Insert or replace one series after fail-closed checks.
Usage
series_bindings.upsert_series_binding(
workbook,
bindings_path,
series,
*,
replace=False,
dynamic_refs=None,
use_cached_dynamic_refs=True,
blank_ranges=None
)Schema load, occupancy, and resolution audit run against a temporary copy. The destination tree is written only after those checks succeed.
Parameters
workbook: Path-
Workbook the sidecar describes.
bindings_path: Path-
Existing sidecar file/directory, or the path to create.
series: Mapping[str, Any]-
One series mapping to insert or replace.
replace: bool = False-
Replace an existing series with the same id.
dynamic_refs: DynamicRefConfig | None = None-
Constraint-based OFFSET/INDEX/INDIRECT config. Ignored when
use_cached_dynamic_refsis True. use_cached_dynamic_refs: bool = True-
Resolve dynamic refs from cached workbook values. Library default is True (same as validate_bindings_workbook). The CLI flag
--use-cached-dynamic-refsdefaults to False, matching otherexcel-grapher bindingscommands. blank_ranges: Sequence[str] | None = None- Sheet-qualified rectangles omitted from the graph.
Raises
BindingUpsertError- The series is not a valid insertion. The destination bindings tree is left unchanged, including when the path did not exist.