def dict_to_attrs(d):
    """Filter to convert a python dictionary into a HTML attributes.

    For each (key, value) pair inside the dict, a ``key=value`` string will
    be created.

    Parameters
    ----------
    d : dict
        Dictionary containing the key value attributes.

    Returns
    -------
    str
        String containing all the attributes of the dictionary separated with spaces.
    """

    attrs = []
    for k, v in d.items():
        attrs.append(f'{k}="{v}"')
    attrs = " ".join(attrs)
    return attrs