from pathlib import Path
import toml


def get_pyproject_toml_entry(proj, *keys):
    """Return [build-system] requires as read from proj/pyproject.toml, if any"""
    pyproject_toml = Path(proj, 'pyproject.toml')
    if not pyproject_toml.exists():
        return None
    config = toml.load(pyproject_toml)
    try:
        for key in keys:
            config = config[key]
        return config
    except KeyError:
        return None