fftools.other

fftools.other.chunks(input_list: list[Any], output_length: int) Generator[list[Any], None, None][source]

get chunks of list -> list of lists.

Parameters:
  • input_list (list[Any]) – the list to split into chunks

  • output_length (int) – length of the chunks

Yields:

the chunked list of lists

Return type:

Generator[list[Any], None, None]

fftools.other.fix_punycode(zone_name: str) str[source]

fix punycode characters in domain name.

Parameters:

zone_name (str) – domain/zone name

Returns:

fixed domain/zone name

Return type:

str

fftools.other.get_random_letters(count: int) str[source]

get a string of random letters.

Parameters:

count (int) – count of random characters in the returned string.

Raises:

ValueError – if count is smaller than 1.

Returns:

the string of random letters.

Return type:

str

fftools.other.pop_dict(input_dict: dict[str, Any], keys: list[str]) dict[str, Any][source]

remove keys (and value for key) from dict.

does not modify the input dict. does nothing if the keys don’t exist in the dict.

Parameters:
  • input_dict (dict[str, Any]) – dict to remove keys from.

  • keys (list[str]) – list of keys to remove.

Returns:

the new dict without the specified keys.

Return type:

dict[str, Any]

fftools.other.progress_bar(progress: float, total: float) None[source]

prints a progress bar.

Parameters:
  • progress (float) – current progress to total. x/total.

  • total (float) – the total.

Return type:

None

fftools.other.wait_random(max_seconds: int) None[source]

wait random amount of seconds.

Parameters:

max_seconds (int) – max seconds to wait

Return type:

None