import requests
import json


def read_json(file):
    """Read JSON from a local file or a URL"""
    if file.startswith("http"):
        r = requests.get(file)
        return json.loads(r.text)
    else:
        with open(file) as f:
            return json.load(f)