This library allows you to enter a destination directory and it organizes its contents according to the extension of the found files. Example. If there is a directory that contains files like "image.jpg', "video.mp4", "books.pdf", it will create directories "jpg", "mp4", "pdf" and store the contents respectively.
In your terminal type
pip install pyarrange==3.0.0
from pyarrange import *
arrange()
#So when in the terminal it asks for the path: enter the directory full path