Skip to content

A lightweight Python utility that uses a GUI folder picker to recursively scan directories, filter files based on a customizable JSON configuration, and compile all text-based content into a single structured output file.

License

Notifications You must be signed in to change notification settings

yigit-guven/Folder-Content-Reader

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Folder Content Reader

Folder Content Reader is a simple Python utility that recursively scans a selected directory, extracts the contents of all readable text files, and compiles them into a single output file.

It is designed to be developer-friendly, offering an easy way to "dump" codebases or document structures for analysis, backups, or LLM prompting.

📋 Prerequisites

  • Python 3.x installed on your system.
  • No external pip packages required (uses standard libraries: os, json, tkinter).

🛠️ How to Use

  1. Run the script:

    python main.py
  2. Select Folder: A popup window will appear (check your taskbar if it doesn't pop up immediately). Navigate to and select the folder you want to read.

  3. Wait for Process: The script will scan the folder and print its progress to the console.

  4. View Output: Open the newly created combined_output.txt file in the project directory. This file contains the paths and contents of every readable file found.

⚙️ Configuration

On the first run, the script automatically generates a config.json file. You can edit this file to customize behavior.

Configuration Options:

  • output_file: Define where the result is saved. Can be a filename ("my_dump.txt") or a full path ("C:/Users/Me/Desktop/dump.txt").
  • ignore_folders: Skip entire directories (e.g., node_modules).
  • ignore_extensions: Skip file types (e.g., .exe, .png).
  • ignore_files: Skip specific filenames (e.g., .gitignore, package-lock.json).

Default Example:

{
    "output_file": "combined_output.txt",
    "ignore_folders": [
            ".git", 
            "node_modules", 
            "__pycache__", 
            "venv", 
            ".idea", 
            ".vscode",
            "dist",
            "build"
        ],
    "ignore_extensions": [
            ".exe", ".dll", ".bin", 
            ".png", ".jpg", ".jpeg", ".gif", ".ico", ".svg",
            ".zip", ".rar", ".pdf", ".tar", ".gz",
            ".pyc", ".pkl"
        ],
    "ignore_files": [
            ".gitignore",
            ".gitattributes",
            "package-lock.json",
            "yarn.lock",
            ".DS_Store",
            "config.json"
        ]
}

About

A lightweight Python utility that uses a GUI folder picker to recursively scan directories, filter files based on a customizable JSON configuration, and compile all text-based content into a single structured output file.

Topics

Resources

License

Stars

Watchers

Forks

Languages