Does python have a module that can do load balancing?

here"s the thing. I want to write the read-write separation of mysql directly in python. If I read it, I just ask for an address. Then read it, there may be multiple mysql addresses, how to do load balancing in python? For example, the default is to distribute requests evenly, and then if a machine has a problem to avoid the request, the machine can resume the read operation of the machine after it is restored. So I"d like to ask if there is a ready-made module to use. Thank you

Nov.19,2021

Why do you want to repeat the wheel? the cloud database comes with it, and there are many database middleware that do this thing

.
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b35b8b-2b31d.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b35b8b-2b31d.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?