capella_diff_tools package

Submodules

capella_diff_tools.compare module

Functions for comparing different types of objects in a Capella model.

capella_diff_tools.compare.compare_all_diagrams(old: MelodyModel, new: MelodyModel) DiagramChanges
capella_diff_tools.compare.compare_all_objects(old: MelodyModel, new: MelodyModel) ObjectChanges

Compare all objects in the given models.

capella_diff_tools.report module

capella_diff_tools.report.generate_html(data: ChangeSummaryDocument) Markup

capella_diff_tools.types module

Types for annotating functions in the diff tool.

class capella_diff_tools.types.BaseObject

Bases: TypedDict

display_name: str

Name for displaying in the frontend.

This is usually the name attribute of the “current” version of the object.

uuid: str
class capella_diff_tools.types.ChangeSummaryDocument

Bases: TypedDict

diagrams: DiagramChanges
metadata: Metadata
objects: ObjectChanges
class capella_diff_tools.types.ChangedAttribute

Bases: TypedDict

current: Any

The new value of the attribute.

previous: Any

The old value of the attribute.

class capella_diff_tools.types.ChangedDiagram

Bases: BaseObject, TypedDict

changed: NotRequired[list[BaseObject]]

Objects that were changed on the diagram.

This does not consider layout changes. See layout_changes.

display_name: str
introduced: NotRequired[list[BaseObject]]

Objects that were introduced to the diagram.

layout_changes: Literal[True]

Whether the layout of the diagram changed.

This will always be true if there were any semantic changes to the diagram.

removed: NotRequired[list[BaseObject]]

Objects that were removed from the diagram.

uuid: str
class capella_diff_tools.types.ChangedObject

Bases: BaseObject, TypedDict

attributes: dict[str, ChangedAttribute]

The attributes that were changed.

display_name: str
uuid: str
class capella_diff_tools.types.DiagramChange

Bases: TypedDict

created: list[FullDiagram]

Diagrams that were created.

deleted: list[FullDiagram]

Diagrams that were deleted.

modified: list[ChangedDiagram]

Diagrams that were changed.

class capella_diff_tools.types.DiagramChanges

Bases: TypedDict

epbs: dict[str, DiagramChange]

Changes on diagrams from the EPBS layer.

la: dict[str, DiagramChange]

Changes on diagrams from the LogicalAnalysis layer.

oa: dict[str, DiagramChange]

Changes on diagrams from the OperationalAnalysis layer.

pa: dict[str, DiagramChange]

Changes on diagrams from the PhysicalAnalysis layer.

sa: dict[str, DiagramChange]

Changes on diagrams from the SystemAnalysis layer.

class capella_diff_tools.types.FullDiagram

Bases: BaseObject, TypedDict

A diagram that was created or deleted.

display_name: str
uuid: str
class capella_diff_tools.types.FullObject

Bases: BaseObject, TypedDict

attributes: dict[str, Any]

All attributes that the object has (or had).

display_name: str
uuid: str
class capella_diff_tools.types.Metadata

Bases: TypedDict

model: dict[str, Any]

The ‘modelinfo’ used to load the models, sans the revision key.

new_revision: RevisionInfo
old_revision: RevisionInfo
class capella_diff_tools.types.ObjectChange

Bases: TypedDict

created: list[FullObject]

Contains objects that were created.

deleted: list[FullObject]

Contains objects that were deleted.

modified: list[ChangedObject]
class capella_diff_tools.types.ObjectChanges

Bases: TypedDict

epbs: dict[str, ObjectChange]

Changes to objects from the EPBS layer.

la: dict[str, ObjectChange]

Changes to objects from the LogicalAnalysis layer.

oa: dict[str, ObjectChange]

Changes to objects from the OperationalAnalysis layer.

pa: dict[str, ObjectChange]

Changes to objects from the PhysicalAnalysis layer.

sa: dict[str, ObjectChange]

Changes to objects from the SystemAnalysis layer.

class capella_diff_tools.types.RevisionInfo

Bases: TypedDict

author: str

The author of the revision, in “Name <email@domain>” format.

date: datetime

The time and date of the revision.

description: str

The description of the revision, i.e. the commit message.

hash: Required[str]

The revision hash.

revision: str

The original revision passed to the diff tool.

Module contents

The capella_diff_tools package.