taika.taika

read_conf(conf_path)[source]

Read the configuration file conf_path. It should be an INI style configuration.

Parameters:
conf_path : str

The path to the configuration file to be readed.

Returns:
conf : configparser.ConfigParser

An instance of a ConfigParser which holds the configuration.

Raises:
SystemExit

If conf_path is not a file.

write_file(document, destination)[source]

Given a document and a destionation, write document.content in the destination.

Parameters:
document : dict

A dictionary representing a document. Should have content and url.

destination : str or pathlib.Path

The destination directory where the document will be written.

Raises:
KeyError

If the document doesn’t have content or url.

read_file(path)[source]

Read path and return the document as a dictionary.

Parameters:
path : str or pathlib.Path

A path to a file to be read.

Returns:
document : dict

A dictionary that holds the information of the document read from path.