mkt.schema.io_utils.serialize_conservation_data

mkt.schema.io_utils.serialize_conservation_data(conservation_data: BaseModel, suffix: str = 'json', str_path: str | None = None) str | None[source]

Serialize a KLIFSConservationData artifact to a single file.

Unlike serialize_kinase_dict() (one file per kinase), this writes the whole single-object artifact to {str_path}/KLIFSConservationData.{suffix}, reusing the DICT_FUNCS serialization registry.

Parameters:
  • conservation_data (BaseModel) – The mkt.schema.conservation_schema.KLIFSConservationData object.

  • suffix (str) – Serialization type supported: json, yaml, toml.

  • str_path (str | None) – Directory to write into, by default None (the mkt.schema package directory).

Returns:

Path written, or None if the suffix is unsupported.

Return type:

str | None