# Attribute Definitions

## AttributeDefinition

class `canlib.kvadblib.``AttributeDefinition`(db, handle)

  Factory for creating different types of attribute definitions.

  This class is also the base class and thus contains all common properties.

  `name`

    Name of attribute definition.

    Type: | `str`

  `owner`

    Return attribute owner

    Type: | `AttributeOwner`

## DefaultDefinition

class `canlib.kvadblib.``DefaultDefinition`(default)

  Attribute definition for attributes defined using only default.

  `default`

    Alias for field number 0

## EnumDefaultDefinition

class `canlib.kvadblib.``EnumDefaultDefinition`(default, enums)

  Attribute definition for enumeration attributes.

  Holds a definition using default and key-value pairs.

  `default`

    Alias for field number 0

  `enums`

    Alias for field number 1

## EnumDefinition

class `canlib.kvadblib.``EnumDefinition`(db, handle, definition=None)

  Definition of an enum attribute.

  `add_enum_definition`(enums)

    Add enum definitions.

    Parameters: | enums (dict) – key - value pair(s), example: {‘empty’: 0}

  `definition`

    Return attribute definition

    Changed in version 1.6.

    Type: | `EnumDefaultDefinition`

## FloatDefinition

class `canlib.kvadblib.``FloatDefinition`(db, handle, definition=None)

  Definition of a float attribute.

  `definition`

    Attribute definition

    Type: | `MinMaxDefinition`

## IntegerDefinition

class `canlib.kvadblib.``IntegerDefinition`(db, handle, definition=None)

  Definition of an integer attribute.

  `definition`

    Return attribute definition

    Type: | `MinMaxDefinition`

## MinMaxDefinition

class `canlib.kvadblib.``MinMaxDefinition`(default, min, max)

  Attribute definition for attributes defined using default, min and max.

  `default`

    Alias for field number 0

  `max`

    Alias for field number 2

  `min`

    Alias for field number 1

## StringDefinition

class `canlib.kvadblib.``StringDefinition`(db, handle, definition=None)

  Definition of a string attribute.

  `definition`

    Return attribute definition

    Type: | `DefaultDefinition`