color_tools.filament_id

Canonical stable identifiers for filament records.

color_tools.filament_id.generate_filament_id(maker, type_name, finish, color)[source]

Generate a stable filament ID from its product identity.

Maker, material type, optional finish, and color name participate in the identifier. Color values and TD values intentionally do not, so those attributes can be corrected without changing references to the filament.

Return type:

str

Parameters:
  • maker (str)

  • type_name (str)

  • finish (str | None)

  • color (str)

color_tools.filament_id.validate_filament_id(value)[source]

Validate and return a canonical lowercase hyphenated filament ID.

Return type:

str

Parameters:

value (str)

color_tools.filament_id.next_available_filament_id(base_id, existing_ids)[source]

Return the base ID or its first available numeric suffix.

Return type:

str

Parameters: