alfred3.util#

Provides miscellaneous utilities for alfred experiments.

New in version 1.5.

Functions

emoji(text[, size])

Returns a new string in which emoji shortcodes in the input string are replaced with their unicode representation.

flatten_dict(d[, prefix_sep, sequences_to_dict])

dict: Turns a nested dictionary into a flat one.

icon(name[, ml, mr, size, spin])

Returns HTML code for displaying font-awesome icons.

is_element(obj)

Returns True, if the given object is an Element, or a subclass of Element.

is_input_element(obj)

Returns True, if the given object is an InputElement, or a subclass of InputElement.

is_label(obj)

Returns True, if the given object is an Label, or a subclass of Label.

is_page(obj)

Returns True, if the given object is a Page, or a subclass of Page.

is_section(obj)

Returns True, if the given object is a Section, or a subclass of Section.

multiple_choice_numbers(choice_dict)

Finds the indexes of the choices saved for a multiple choice element.

prefix_keys(d, prefix[, sep])

dict: Returns the input dictionary with prefixed keys.

prefix_keys_safely(data, base[, prefix, sep])

Takes the data dict and prefixes its keys in a way that makes sure that there are no keys that are present in both the resulting prefixed dictionary and the base dictionary.

to_dict(data[, prefix, sep])

dict: Turns an iterable into a flat dictionary.