WriterAbstract#

class WriterAbstract(params=None, **kwargs)#

Bases: Generic[T_Source_contra, T_Data], Module

Abstract class of Writer module.

Parameters:
  • params (Any | None)

  • kwargs (Any)

check_directories(calls)#

Check if directories are missing, and create them if necessary.

Parameters:

calls (Sequence[tuple[T_Source_contra, T_Data]])

Return type:

None

check_directory(call)#

Check if directory is missing, and create it if necessary.

Parameters:

call (tuple[T_Source_contra, T_Data])

Return type:

None

check_overwriting_calls(calls)#

Check if some calls have the same filename.

Parameters:

calls (Sequence[tuple[T_Source_contra, T_Data]])

Return type:

None

get_metadata(**kwargs)#

Get information on how data was created.

Uses metadata_generator.

Parameters:

kwargs (Any) – Options passed to MetadataOptions

Return type:

dict[str, Any]

metadata_generator#

alias of MetadataGenerator

Section options_cls#

Options for metadata generator.

options_cls.methods: List[Unicode] | None#

  • Default value: None

Manually specify methods to run. If left to None, all methods are run.

options_cls.add_params: Bool#

  • Default value: True

If True add parameters (either as dict or str).

options_cls.add_git_info: Bool#

  • Default value: True

If True add information about git repository status.

options_cls.params_exclude: List[Unicode]#

  • Default value: ['log_']

Prefixes of parameters to exclude from metadata attribute.

options_cls.params_str: Bool#

  • Default value: True

If True, serialize parameters using JSON.

options_cls.max_diff_lines: Int#

  • Default value: 30

Maximum number of lines to include in diff.

options_cls.creation_script: Unicode | None#

  • Default value: None

Manually specify the creation script.

options_cls.git_ignore: List[Unicode]#

  • Default value: []

Files and folders to ignore when creating git diff.

send_calls(calls, **kwargs)#

Send multiple calls serially.

Check beforehand if there are filename conflicts betwen calls, and make sure the necessary (sub)directories are created if they not exist already.

Parameters:
Return type:

list[Any]

send_single_call(call, **kwargs)#

Execute a single call.

Not implemented:

implement in a module subclass.

Parameters:
Return type:

Any

write(data, target=None, metadata_kwargs=None, **kwargs)#

Write data to file or store.

Not implemented:

implement in a module subclass.

Parameters:
Return type:

Any