Skip to content

Quantity

Quantity encapsulates numeric quantities encountered in tables or annotations, such as required part counts or batch sizes. The model stores the numeric value as a decimal together with its unit, giving you a reliable data point for planning. Pairing the value with an explicit unit avoids ambiguity when quantities are expressed in pieces, kilograms, or other measures. This structure is particularly useful for procurement automation, inventory reconciliation, or generating pick lists directly from drawings. Use the Quantity object to ensure every callout that impacts ordering or scheduling is accounted for without manually scanning each table.

Bases: BaseModel

Represents a Physical Quantity with a value and a unit.

PARAMETER DESCRIPTION
value

The value of the quantity.

TYPE: Decimal

unit

The unit of the quantity.

TYPE: str

Source code in werk24/models/v2/models.py
class Quantity(BaseModel):
    """
    Represents a Physical Quantity with a value and a unit.
    """

    value: Decimal = Field(
        ...,
        description="The value of the quantity.",
        examples=[Decimal("10.5")],
        allow_inf_nan=True,  # Allowing inf for "R PLANE"
    )
    unit: str = Field(
        ...,
        description="The unit of the quantity.",
        examples=["mm"],
    )