hansken_extraction_plugin.api.transformation

This module contains the definition of a Transformation.

Classes

Range(offset, length)

A Range describes a range of bytes with a offset and length.

RangedTransformation(ranges)

A :class:RangedTransformation describes a data transformation consisting of a list of :class:Range.

Transformation()

A super class for data transformations.

class Transformation[source]

Bases: ABC

A super class for data transformations. Currently only :class:RangedTransformation is supported.

class Range(offset: int, length: int)[source]

Bases: object

A Range describes a range of bytes with a offset and length.

offset: int

the starting point of the data

length: int

the size of the data

class RangedTransformation(ranges: List[Range])[source]

Bases: Transformation

A :class:RangedTransformation describes a data transformation consisting of a list of :class:Range.

static builder()[source]

:return a Builder.

class Builder[source]

Bases: object

Helper class that implements a transformation builder.

add_range(offset: int, length: int) Builder[source]

Add a range to a ranged transformation by providing the range’s offset and length.

:param offset the offset of the data transformation :param length the length of the data transformation :return: this .RangedTransformation.Builder

build() RangedTransformation[source]

Return a RangedTransformation.

Returns:

a :class:RangedTransformation