jangada.mixin.Taggable.tag#

Taggable.tag: str | None#

Symbolic identifier for namespace-style access.

A validated string that must be a valid Python identifier (but not a keyword). Intended for programmatic, attribute-style access in containers and namespaces, similar to how pandas DataFrames expose columns.

See also

Nameable.name

Human-readable display name

Notes

Tags are mutable (can be changed) to support dynamic reorganization of namespaces. Uniqueness is not enforced globally - containers should manage tag uniqueness within their scope.

Use tags for programmatic access, not display. For human-readable labels, use the name property from Nameable.

Examples

Valid tags:

obj.tag = "sensor_a"
obj.tag = "temp_sensor_01"
obj.tag = "_private"

Invalid tags:

obj.tag = "123invalid"      # Starts with digit
obj.tag = "invalid-tag"     # Contains hyphen
obj.tag = "invalid tag"     # Contains space
obj.tag = "if"              # Python keyword
obj.tag = ""                # Empty string

Namespace access pattern:

# Container provides attribute-style access by tag
system.sensor_a  # Returns object with tag='sensor_a'

Whitespace normalization:

obj.tag = "  my_tag  "
assert obj.tag == "my_tag"