Nodes/ComfyUI-Data-Analysis/Pandas Excel File Sheet Names
ComfyUI Node

Pandas Excel File Sheet Names

Find out what's actually inside that .xlsx

By HowToSD·Created 2 years ago·Updated about a year ago· 23
Pandas Excel File Sheet Names
    • PYLIST
    file_path

    Excel files are where tabular data goes to hide. You get handed a workbook and the interesting numbers are on some tab called "Sheet3" or "v2_FINAL (1)" and you have no idea which one is which. Pandas Excel File Sheet Names is the node that answers that: point it at an .xlsx file and it returns the list of sheet names in that workbook. That's the entire job, and it's genuinely useful before you do anything else with the file, because every other Excel-loading step in this pack - Pandas Load Excel - makes you name a sheet explicitly.

    It's part of the ComfyUI-Data-Analysis pack, Hide Inada's collection that turns pandas into a visual graph. This node is its "introspection" step: one of those small utilities you reach for once per dataset, right after loading, and then never think about again.

    How it works

    The node calls pd.ExcelFile(file_path, engine="openpyxl").sheet_names and hands back the result. Two implementation details worth knowing. First, it uses the openpyxl engine, which is why the pack lists openpyxl in requirements.txt - that dependency is exactly what makes this node work, and the author's docstring calls that out. Second, openpyxl only reads .xlsx (and .xlsm) - the legacy .xls binary format from pre-2007 Excel is not covered. If your file is .xls, this node won't open it, and neither will the pack's Excel loader.

    The output is a plain Python list (PYLIST socket). To actually see it in ComfyUI you can't just leave it dangling - the author's own docstring gives the recipe: connect it to Py List To String to turn the list into text, then into Pandas Show Text to display it. That's a two-node detour that reads awkwardly until you've done it once.

    The one thing that might surprise you: the node is flagged IS_CHANGED to always re-run, so it re-reads the file's sheet names on every queue rather than caching a stale result. If you edit the workbook and re-run, you get fresh names without clearing anything.

    Inputs and outputs

    • file_path (required, STRING) - the path to the Excel file. Use an absolute path; like the rest of the pack's file nodes, relative paths resolve against your ComfyUI install directory, which trips people up constantly.
    • PYLIST output - the sheet names, in workbook order. Feed it through Py List To String + Pandas Show Text to see them.

    Installing it

    Standard pack install. ComfyUI Manager → search "Data analysis" → install ComfyUI-Data-Analysis → restart → reload. Manual:

    cd ComfyUI/custom_nodes
    git clone https://github.com/HowToSD/ComfyUI-Data-Analysis
    mv ComfyUI-Data-Analysis data-analysis
    pip install -r data-analysis/requirements.txt
    

    That requirements file is what actually gets you openpyxl (and pandas, matplotlib, seaborn, scipy, scikit-learn, lxml). No GPU, no model downloads - this is all CPU, and the only thing that can bite you is forgetting to install the requirements, because base ComfyUI doesn't ship any of them.

    CategoryData Analysis

    Inputs (1)

    NameTypeDefaultDescription
    file_pathSTRING

    Outputs (1)

    NameTypeDescription
    PYLISTPYLIST