from typing import Tuple
from typing import Optional
from typing import Any
import requests
import json
from typing import OrderedDict


def json_get(iiif_uri: str) -> Tuple[int, Optional[Any]]:
    """
    Return an OrderedDict from a URI which returns JSON.

    :param iiif_uri: ID/URI for the JSON
    :return: html status code, OrderedDict
    """
    r = requests.get(iiif_uri)
    if r.status_code == requests.codes.ok:
        od = json.loads(r.text, object_pairs_hook=OrderedDict)
        return r.status_code, od
    else:
        return r.status_code, None