Value types

Overview

NCP data types are mapped onto python types as follows:

NCP type Python type
i32 int
u32 ncplib.u32
i64 ncplib.i64
u64 ncplib.u64
f32 float
f64 ncplib.f64
string str
raw bytes
data i8 array.array(typecode="b")
data i16 array.array(typecode="h")
data i32 array.array(typecode="i")
data u8 array.array(typecode="B")
data u16 array.array(typecode="H")
data u32 array.array(typecode="I")
data u64 array.array(typecode="L")
data i64 array.array(typecode="l")
data f32 array.array(typecode="f")
data f64 array.array(typecode="d")

API reference

class ncplib.u32

A u32 value.

Wrap any int values to be encoded as u32 in u32.

class ncplib.i64

An i64 value.

Wrap any int values to be encoded as i64 in i64.

class ncplib.u64

A u64 value.

Wrap any int values to be encoded as u64 in u64.

class ncplib.f64

A f64 value.

Wrap any float values to be encoded as f64 in f64.