My short description for my project.
Project description
File to Folder
This simple Python script, file_to_folder.py
, is designed to organize files by moving them into folders based on their names. It can be useful for maintaining a clean and structured file system. The script works for both single files and entire directories.
Usage
-
Clone the Repository:
git clone https://github.com/your-username/file-to-folder-organizer.git
-
Navigate to the Project Directory:
cd file-to-folder-organizer
-
Run the Script:
python file_to_folder.py
Follow the on-screen instructions to input the file or folder path.
How it Works
-
If the input is a single file, the script extracts the file name (excluding the extension) and checks if it matches the immediate parent folder's name. If not, it creates a new folder with the file name and moves the file into it.
-
If the input is a directory, the script recursively goes through all files and subdirectories. For each file, it follows the same logic as for a single file.
Example
Suppose you have a file named example.txt
in a folder named Documents
. Running the script on this file will create a new folder named example
and move the file into it. The resulting structure will look like this:
- Documents
- example
- example.txt
Note
-
The script does not overwrite existing files. If a folder with the same name already exists, it will append a number to the folder's name to avoid conflicts.
-
Be cautious when using this script, especially on important directories, as it involves moving and potentially restructuring files.
Feel free to use, modify, and distribute this script according to your needs. If you encounter any issues or have suggestions for improvement, please open an issue or submit a pull request.
License
This project is licensed under the MIT License. See the LICENSE file for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for file_to_folder-0.0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1ab93e1c3b92fe3e838af6c07175c1db8ad1f3f4261a2b00b9a6d0132943fecd |
|
MD5 | 1025ef230655961fbad77cf33b848fb8 |
|
BLAKE2b-256 | 1ca726386eac7b40f87846b6ba0fb53194bc0566765269db08171de1f875ac04 |