https://github.com/romanslack/llm_collate-code
https://github.com/romanslack/llm_collate-code
Last synced: 9 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/romanslack/llm_collate-code
- Owner: RomanSlack
- License: mit
- Created: 2025-03-31T17:14:27.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-04-22T16:41:41.000Z (about 1 year ago)
- Last Synced: 2025-04-22T17:52:28.404Z (about 1 year ago)
- Language: Python
- Size: 38.1 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Collate Code
A simple Python script that collects code from specified file paths on Windows 10. It copies each file’s content, labels it by programming language, and saves everything into a single JSON file – perfect for feeding into a Large Language Model (LLM).
## How It Works
1. You provide a list of file paths in the script.
2. The script reads each file and identifies its language from the file extension.
3. All code snippets are compiled into a single JSON file called `aggregated_files.json`.
## Getting Started
1. Clone or download this repository.
2. Update the `file_paths` list with the files you want to aggregate.
3. Run the script: `python collate_code.py`
4. Open `aggregated_files.json` to see your collated data.
## Customization
- Extend the `extension_map` dictionary to add mappings for more programming languages or file types.
- Swap out the JSON output for plain text or any other format you prefer.
## License
This project is licensed under the [MIT License](LICENSE). Feel free to use it and adapt it to suit your needs. Enjoy collating your code!