pyspj.models.general

load_result

pyspj.models.general.load_result(data, type_=None)pyspj.models.base.SPJResult[source]
Overview:

Load the given result data with result type’s format.

Arguments:
  • data: The given original result data.

  • type_: The expected type. Default is None, which means ResultType.FREE.

Returns:
  • result (SPJResult): Converted result object.

to_continuity

pyspj.models.general.to_continuity(data)pyspj.models.continuity.ContinuitySPJResult[source]
Overview:

Transform the given data to pyspj.models.simple.ContinuitySPJResult object.

Arguments:
  • data: The given original data.

Returns:
  • result (ContinuitySPJResult): Converted result object.

to_simple

pyspj.models.general.to_simple(data)pyspj.models.simple.SimpleSPJResult[source]
Overview:

Transform the given data to pyspj.models.simple.SimpleSPJResult object.

Arguments:
  • data: The given original data.

Returns:
  • result (SimpleSPJResult): Converted result object.

ResultType

enum pyspj.models.general.ResultType(value)[source]
Overview:

Loading types of the result.

Member Type

int

Valid values are as follows:

FREE = <ResultType.FREE: 0>

Free mode. Just use the returned result.

SIMPLE = <ResultType.SIMPLE: 1>

Simple mode. Convert the returned result to simple spj result.

CONTINUITY = <ResultType.CONTINUITY: 2>

Continuity mode. Conbert the returned result to continuity spj result.

The Enum and its members also have the following methods:

classmethod loads(data) → Optional[pyspj.models.general.ResultType]
Overview:

Load enum data from raw data.

Arguments:
  • data (Any): Data which going to be parsed.

Returns:
  • enum_data (:obj:): Parsed enum data