Kompressor is a Python script that generates a comprehensive overview of a project by compiling all README.md files and code files with specified extensions into a single output file. It's designed to provide a quick and easy way to create a complete picture of a project for analysis by Large Language Models (LLMs) or for human review.
- Includes all README.md files found in the project directory and its subfolders
- Supports multiple file extensions for code files
- Customizable output file name
- Clear separation and labeling of different files in the output
- Comprehensive error handling for production use
- Ensure you have Python 3.6 or higher installed on your system.
- Clone this repository or download the
kompressor.py
script.
Run Kompressor from the command line with the following syntax:
python kompressor.py [-h] [-e EXTENSIONS [EXTENSIONS ...]] [-d DIRECTORY] [-o OUTPUT]
-h, --help
: Show the help message and exit-e EXTENSIONS [EXTENSIONS ...], --extensions EXTENSIONS [EXTENSIONS ...]
: File extensions to include (default: .py). For multiple extensions, separate with spaces. README.md files are always included.-d DIRECTORY, --directory DIRECTORY
: Root directory of the code (default: current directory). All subfolders will be searched for README.md files and specified file types.-o OUTPUT, --output OUTPUT
: Output file name (default: kompressor_output.txt)
-
Default usage (Python files and all READMEs from all subfolders in current directory, output to kompressor_output.txt):
python kompressor.py
-
Specify a single extension:
python kompressor.py -e py
-
Specify multiple extensions:
python kompressor.py -e py js css
-
Specify directory and output file:
python kompressor.py -d /path/to/project -o project_overview.txt
-
Combine all options:
python kompressor.py -e py js css -d /path/to/project -o project_overview.txt
Kompressor generates a single text file containing:
- An explanation header describing the contents of the file
- All README.md files found in the project directory and its subfolders
- All code files with the specified extensions
Each file in the output is clearly labeled with its relative path in the project structure.
This project is licensed under the MIT License - see the LICENSE file for details.
Contributions to Kompressor are welcome! Please feel free to submit a Pull Request.
If you encounter any problems or have any questions about Kompressor, please open an issue in the GitHub repository.