twine

Python Implementation

function load

Loads twine data from a file object.

def load(file: BinaryIO, chunk_size=512) -> any:

Arguments

Returns


function loads

Loads twine data from a bytes-like object

def load(data: ByteString) -> any:

Argsuments

Returns


function dump

Encodes data and writes the result to a file

def dump(data, file: BinaryIO, chunk_size: int = 512) -> None:

Arguments


function dumps

Encodes data and returns it either as a bytes object or as a generator.

def dumpb(data, lazy: bool = False) -> Union[bytes, Generator]

Arguments

Returns


function set_handlers

Set the handlers for a data type

def set_handlers(data_type: type, type_code: int, encoder: Callable, decoder: Callable) -> None:

Arguments