import requests


def request_smiles(lig_id):
    """Fetch the SMILES string for a given ligand ID"""
    r = requests.get(
        "https://data.rcsb.org/rest/v1/core/chemcomp/{}".format(lig_id)
    )
    if r.status_code == requests.codes.ok:
        return r.json()['rcsb_chem_comp_descriptor']['smiles']
    else:
        print(r.text)
        return r.status_code