This project parses a single input file containing multiple code snippets, each associated with specific file paths, and organizes them into a well-structured directory tree.
- Automated Directory Creation: Automatically creates directories and files based on specified paths.
Follow these steps to get your Code Organizer up and running:
- Python 3.x
- Git
-
Clone the Repository
git clone https://github.com/MSotoudeh/code-organizer.git cd code-organizer
-
Install Dependencies
No external dependencies required.
-
Prepare Your Input File
Edit the
data/input_code.txt
file to include your code snippets and their respective paths. Example:/project/src/app/main.py import os def main(): print("Main function in main.py") if __name__ == "__main__": main() /project/src/app/utils/helpers.py def greet(name): return f"Hello, {name}!" def farewell(name): return f"Goodbye, {name}."
-
Run the Organizer
Execute the
main.py
script to organize your code:python main.py
This will create the necessary directories and files, organizing your code as specified in
data/input_code.txt
.
After running the script, your repository structure will look like this:
output_repo/
├── project/
│ ├── src/
│ │ └── app/
│ │ ├── main.py
│ │ └── utils/
│ │ └── helpers.py
│ ├── tests/
│ │ └── test_helpers.py
│ └── README.md
We welcome contributions! If you have suggestions for improvements or new features, feel free to create an issue or submit a pull request.
This project is licensed under the MIT License. See the LICENSE file for details.
For any inquiries, please reach out to:
- M. Sotoudeh: [email protected]
- GitHub: MSotoudeh
Thank you for using Code Organizer! Happy coding!