from typing import Dict
from typing import Any
import toml


def parse_pyproject_toml(path_config: str) -> Dict[str, Any]:
    """Parse a pyproject toml file, pulling out relevant parts for Black
    If parsing fails, will raise a toml.TomlDecodeError
    """
    pyproject_toml = toml.load(path_config)
    config = pyproject_toml.get("tool", {}).get("vsot", {})
    return {k.replace("--", "").replace("-", "_"): v for k, v in config.items()}