You can do it in python but i would suggest many other ways to distribute renders:
Here are some ways you can try ordered from easiest to do to hardest
Use a render farm (Shameless Plug)
https://sarfis.xyz/
Use placeholders
https://blenderartists.org/t/what-is-placeholders-use-for/543989/2
Use crowd render (Not sure if it does animations)
https://www.crowd-render.com/
Use a render manager (They all suck)
http://opensourcevfx.org/tag/render-queue/