import requests


def fixer_sync(file_path):
    """
    downloads the rates JSON to the local location,
    'file_path' is the location where the fixer.io rates will the placed,
    returns status_code, if it is 200 then file successfully created
    """
    url = 'http://api.fixer.io/latest'
    response = requests.get(url, stream=True)
    if response.status_code == 200:
        with open(file_path, 'wb') as json_file:
            json_file.write(response.content)

    return response.status_code