Skip to content

gds_software.c4.elements

C4 model element declarations -- frozen Pydantic models for user-facing declarations.

Bases: BaseModel

A person that interacts with the system.

Maps to: GDS BoundaryAction (exogenous input).

Source code in packages/gds-software/gds_software/c4/elements.py
class Person(BaseModel, frozen=True):
    """A person that interacts with the system.

    Maps to: GDS BoundaryAction (exogenous input).
    """

    name: str
    description: str = ""

Bases: BaseModel

An external system that the system interacts with.

Maps to: GDS BoundaryAction (exogenous input).

Source code in packages/gds-software/gds_software/c4/elements.py
class ExternalSystem(BaseModel, frozen=True):
    """An external system that the system interacts with.

    Maps to: GDS BoundaryAction (exogenous input).
    """

    name: str
    description: str = ""

Bases: BaseModel

A deployable unit (API, database, web app, etc).

Maps to: GDS Policy (if stateless) or Mechanism (if stateful/database).

Source code in packages/gds-software/gds_software/c4/elements.py
class Container(BaseModel, frozen=True):
    """A deployable unit (API, database, web app, etc).

    Maps to: GDS Policy (if stateless) or Mechanism (if stateful/database).
    """

    name: str
    technology: str = ""
    stateful: bool = False
    description: str = ""

Bases: BaseModel

A component within a container.

Maps to: GDS Policy or Mechanism based on stateful flag.

Source code in packages/gds-software/gds_software/c4/elements.py
class C4Component(BaseModel, frozen=True):
    """A component within a container.

    Maps to: GDS Policy or Mechanism based on stateful flag.
    """

    name: str
    container: str = Field(description="Parent container name")
    technology: str = ""
    stateful: bool = False
    description: str = ""

Bases: BaseModel

A directed relationship between C4 elements.

Maps to: GDS Wiring.

Source code in packages/gds-software/gds_software/c4/elements.py
class C4Relationship(BaseModel, frozen=True):
    """A directed relationship between C4 elements.

    Maps to: GDS Wiring.
    """

    name: str
    source: str
    target: str
    technology: str = ""
    description: str = ""