INNER CODE UNIT · Python

parse_requirements

Nain57/Smart-AutoClicker · scripts/ocr-models/dependency_checker.py:25

def parse_requirements(file_path: str):
    """
    Extract package names from requirements.txt.
    Ignores versions, comments, and options.
    """
    packages = []

    with open(file_path, "r", encoding="utf-8") as f:
        for line in f:
            line = line.strip()

            # ignore comments / empty lines
            if not line or line.startswith("#"):
                continue

            # remove version constraints: package==1.2.3, >=, <=, etc.
            pkg = re.split(r"[<>=!~]", line)[0].strip()

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…