def METHOD_NAME(directory, crate_name):
    try:
        url = '{}/{}'.format(CRATES_API_URL, crate_name)
        with urllib.request.urlopen(url) as response:
            code = response.code
            data = response.read().decode('utf-8')
            data = json.loads(data)
        path = os.path.join(directory, 'data.json')
        with open(path, 'w') as fp:
            json.dump(data, fp, indent=4)
        max_version = data['crate']['max_version']
        identifier = data['crate']['id']
        name = data['crate']['name']
        downloads = data['crate']['downloads']
        recent_downloads = data['crate']['downloads']
        check_version(max_version)
        version_info = [
            version
            for version in data['versions']
            if version['num'] == max_version
        ][0]
        dependencies_url = CRATES_URL + version_info['links']['dependencies']
        with urllib.request.urlopen(dependencies_url) as response:
            code = response.code
            dependencies = response.read().decode('utf-8')
            dependencies = json.loads(dependencies)
        path = os.path.join(directory, 'dependencies.json')
        with open(path, 'w') as fp:
            json.dump(dependencies, fp, indent=4)
        dependency_count = len(dependencies['dependencies'])
        return CrateInfo(
            identifier,
            name,
            max_version,
            dependency_count,
            downloads,
            recent_downloads,
            version_info['dl_path'],
            )
    except Exception as e:
        print(e)
        return None