BasicType

class tracdap.rt.metadata.BasicType

Bases: enum.Enum

Basic types provide the set of core types available in the TRAC type system.

ARRAY = 8

An array of values, which may be primitive or composite values.

All items in an array must have the same type (i.e. the same type descriptor).

BASIC_TYPE_NOT_SET = 0
BOOLEAN = 1

A true/false value

DATE = 6

A date value.

Dates do not take any account of time zones or offsets from UTC.

DATETIME = 7

A date-time value.

Date-time values may be expressed with an offset from UTC, as per ISO 8601. The available sub-second precision may vary depending on language / platform.

For metadata attributes, TRAC represents all date-times as in UTC with microsecond precision. Incoming values will be converted to UTC if they are supplied with an offset.

DECIMAL = 5

A fixed-point decimal value with known precision and scale.

The available precision and scale may vary between languages / platforms.

For metadata attributes, TRAC provides the following guarantees on precision:

  • precision >= 31

  • scale >= 10

  • precision - scale >= 21

FLOAT = 3

64 bit signed floating point number (referred to as ‘double’ in many languages)

INTEGER = 2

64 bit signed integer

MAP = 9

An key-value map with string keys, values may be primitive or composite values.

All values in a map must have the same type (i.e. the same type descriptor).

See also

TypeDescriptor

STRING = 4

UTF encoded string value of arbitrary length.

The encoding used (e.g. UTF-8, UTF-16, UCS-16) varies between languages / platforms, generally TRAC will present strings using the standard encoding for a given language or protocol.

STRUCT = 10

A nested structure with a named set of fields, which may be primitive or composite values.