Python API Reference

Below are the Python API reference for the Sia serialization library.

Constructor

Attributes

NameDescription
contentThe current content of the Sia instance.
indexThe current offset of the Sia instance pointer.

Methods

NameDescription
seekChanges the offset of the Sia instance pointer.
set_contentReplaces the content of the Sia instance with the given content.
embed_siaAdds the content of the provided Sia instance to the current content.
embed_bytesAdds the provided bytes to the current content.
add_uint8Adds an unsigned 8-bit integer to the current content.
add_uint16Adds an unsigned 16-bit integer to the current content.
add_uint32Adds an unsigned 32-bit integer to the current content.
add_uint64Adds an unsigned 64-bit integer to the current content.
add_int8Adds a signed 8-bit integer to the current content.
add_int16Adds a signed 16-bit integer to the current content.
add_int32Adds a signed 32-bit integer to the current content.
add_int64Adds a signed 64-bit integer to the current content.
write_string_nWrites a null-terminated UTF-8 string to the current content.
add_string8Writes an ASCII string to the current content.
add_string16Writes a UTF-16 string to the current content.
add_string32Writes a UTF-32 string to the current content.
add_string64Writes a UTF-64 string to the current content.
add_byte_array_nWrites a byte array to the current content.
add_byte_array8Writes an 8-bit byte array to the current content.
add_byte_array16Writes a 16-bit byte array to the current content.
add_byte_array32Writes a 32-bit byte array to the current content.
add_byte_array64Writes a 64-bit byte array to the current content.
add_boolWrites a boolean to the current content.
add_big_intWrites a big integer to the current content.
add_array8Writes an 8-bit array to the current content.
add_array16Writes a 16-bit array to the current content.
add_array32Writes a 32-bit array to the current content.
add_array64Writes a 64-bit array to the current content.
read_boolReads a boolean from the current content.
read_uint8Reads an unsigned 8-bit integer from the current content.
read_uint16Reads an unsigned 16-bit integer from the current content.
read_uint32Reads an unsigned 32-bit integer from the current content.
read_uint64Reads an unsigned 64-bit integer from the current content.
read_int8Reads a signed 8-bit integer from the current content.
read_int16Reads a signed 16-bit integer from the current content.
read_int32Reads a signed 32-bit integer from the current content.
read_int64Reads a signed 64-bit integer from the current content.
read_string_nReads a null-terminated UTF-8 string from the current content.
read_string8Reads an ASCII string from the current content.
read_string16Reads a UTF-16 string from the current content.
read_string32Reads a UTF-32 string from the current content.
read_string64Reads a UTF-64 string from the current content.
read_byte_array_nReads a byte array from the current content.
read_byte_array8Reads an 8-bit byte array from the current content.
read_byte_array16Reads a 16-bit byte array from the current content.
read_byte_array32Reads a 32-bit byte array from the current content.
read_byte_array64Reads a 64-bit byte array from the current content.
read_array8Reads an 8-bit array from the current content.
read_array16Reads a 16-bit array from the current content.
read_array32Reads a 32-bit array from the current content.
read_array64Reads a 64-bit array from the current content.

Utility Methods

seek

Changes the offset of the Sia instance pointer.

set_content

Replaces the content of the Sia instance with the given content.

embed_sia

Adds the content of the provided Sia instance to the current content.

embed_bytes

Adds the provided bytes to the current content.

Add Methods

add_uint8

Adds an unsigned 8-bit integer to the current content.

add_uint16

Adds an unsigned 16-bit integer to the current content.

add_uint32

Adds an unsigned 32-bit integer to the current content.

add_uint64

Adds an unsigned 64-bit integer to the current content.

add_int8

Adds a signed 8-bit integer to the current content.

add_int16

Adds a signed 16-bit integer to the current content.

add_int32

Adds a signed 32-bit integer to the current content.

add_int64

Adds a signed 64-bit integer to the current content.

write_string_n

Writes a null-terminated UTF-8 string to the current content.

add_string8

Writes an ASCII string to the current content.

add_string16

Writes a UTF-16 string to the current content.

add_string32

Writes a UTF-32 string to the current content.

add_string64

Writes a UTF-64 string to the current content.

add_byte_array_n

Writes a byte array to the current content.

add_byte_array8

Writes an 8-bit byte array to the current content.

add_byte_array16

Writes a 16-bit byte array to the current content.

add_byte_array32

Writes a 32-bit byte array to the current content.

add_byte_array64

Writes a 64-bit byte array to the current content.

add_bool

Writes a boolean to the current content.

add_big_int

Writes a big integer to the current content.

add_array8

Writes an 8-bit array to the current content.

add_array16

Writes a 16-bit array to the current content.

add_array32

Writes a 32-bit array to the current content.

add_array64

Writes a 64-bit array to the current content.

Read Methods

read_uint8

Reads an unsigned 8-bit integer from the current content.

read_uint16

Reads an unsigned 16-bit integer from the current content.

read_uint32

Reads an unsigned 32-bit integer from the current content.

read_uint64

Reads an unsigned 64-bit integer from the current content.

read_int8

Reads a signed 8-bit integer from the current content.

read_int16

Reads a signed 16-bit integer from the current content.

read_int32

Reads a signed 32-bit integer from the current content.

read_int64

Reads a signed 64-bit integer from the current content.

read_string_n

Reads a null-terminated UTF-8 string from the current content.

read_string8

Reads an ASCII string from the current content.

read_string16

Reads a UTF-16 string from the current content.

read_string32

Reads a UTF-32 string from the current content.

read_string64

Reads a UTF-64 string from the current content.

read_byte_array_n

Reads a byte array from the current content.

read_byte_array8

Reads an 8-bit byte array from the current content.

read_byte_array16

Reads a 16-bit byte array from the current content.

read_byte_array32

Reads a 32-bit byte array from the current content.

read_byte_array64

Reads a 64-bit byte array from the current content.

read_bool

Reads a boolean from the current content.

read_big_int

Reads a big integer from the current content.

read_array8

Reads an 8-bit array from the current content.

read_array16

Reads a 16-bit array from the current content.

read_array32

Reads a 32-bit array from the current content.

read_array64

Reads a 64-bit array from the current content.

How was this page?

Timeleap SA.

Pl. de l'Industrie 2, 1180 Rolle, Switzerland

Logo

Social Media

Tokenomics

Info