dicogis.export.base_serializer module

class dicogis.export.base_serializer.MetadatasetSerializerBase(localized_strings=None, output_path=None, opt_raw_path=False, opt_size_prettify=True)

Bases: object

Base class for metadataset serializers.

__init__(localized_strings=None, output_path=None, opt_raw_path=False, opt_size_prettify=True)

Initialize object.

classmethod get_serializer_from_parameters(format_or_serializer, output_path=None, opt_raw_path=False, opt_prettify_size=True, localized_strings=None)

Initiate the adequat serializer depending on parameters.

Parameters:
  • format_or_serializer (str | OutputFormats.excel | OutputFormats.json | OutputFormats.udata | MetadatasetSerializerBase) – output format or serializer

  • output_path (Path | None) – output path

  • opt_raw_path (bool) – option to serialize dataset raw path without any sugar syntax

  • opt_prettify_size (bool) – option to prettify size in octets (typically: 1 ko instead of 1024 octects)

  • localized_strings (dict | None) – localized texts. Defaults to None.

Return type:

MetadatasetSerializerBase

Returns:

serializer already initialized

post_serializing(**kwargs)

Operations to run after serialization.

pre_serializing(**kwargs)

Operations to run before serialization.