from typing import Iterable
from typing import Tuple
from typing import Any
from typing import Dict


def provider_dict(items: Iterable[Tuple[str, Any]]) -> Dict[str, Any]:
    """Prepare provider data for JSON dump"""
    output = {}
    for key, value in items:
        if key == "ranges":
            output[key] = {
                str(target): [str(net) for net in nets]
                for target, nets in value.items()
            }
        else:
            output[key] = value
    return output