:mod:`khard.helpers`
====================

.. py:module:: khard.helpers

.. autoapi-nested-parse::

   Some helper functions for khard



Module Contents
---------------


.. function:: pretty_print(table: List[List[str]], justify: str = 'L') -> str

   Converts a list of lists into a string formatted like a table
   with spaces separating fields and newlines separating rows


.. function:: list_to_string(input: Union[str, List], delimiter: str) -> str

   converts list to string recursively so that nested lists are supported

   :param input: a list of strings and lists of strings (and so on recursive)
   :param delimiter: the deimiter to use when joining the items
   :returns: the recursively joined list


.. function:: string_to_list(input: Union[str, List[str]], delimiter: str) -> List[str]


.. function:: string_to_date(string: str) -> datetime

   Convert a date string into a date object.

   :param string: the date string to parse
   :returns: the parsed datetime object


.. function:: get_random_uid() -> str


.. function:: file_modification_date(filename: str) -> datetime


.. function:: convert_to_yaml(name: str, value: Union[None, str, List], indentation: int, index_of_colon: int, show_multi_line_character: bool) -> List[str]

   converts a value list into yaml syntax

   :param name: name of object (example: phone)
   :param value: object contents
   :type value: str, list(str), list(list(str)), list(dict)
   :param indentation: indent all by number of spaces
   :param index_of_colon: use to position : at the name string (-1 for no
       space)
   :param show_multi_line_character: option to hide "|"
   :returns: yaml formatted string array of name, value pair


.. function:: indent_multiline_string(input: Union[str, List], indentation: int, show_multi_line_character: bool) -> str


.. function:: get_new_contact_template(supported_private_objects: Optional[List[str]] = None) -> str


