aioshutil is a Python library which provides asynchronous version of function of shutil module. shutil module is blocking and using it in asyncio applications will block the event loop and slow down the application, aioshutil provides asynchronous friendly versions of the functions of the shutil module as it performs blocking io in a thread pool.
$ pip install aioshutilThe API of aioshutil module is same as shutil module except that it is asynchronous.
from aioshutil import rmtree
await rmtree("/tmp")aioshutil provides the following functions:
copyfileobjcopyfilecopymodecopystatcopycopy2copytreemovermtreemake_archiveget_archive_formatsregister_archive_formatunregister_archive_formatget_unpack_formatsregister_unpack_formatunregister_unpack_formatunpack_archiveignore_patternschownwhichget_terminal_size
aioshutil provides the following exceptions for consistency with shutil module:
ErrorSpecialFileErrorSameFileError