This will automatically write a book in Minecraft. It'll write the page, automatically go to the next page then sign the book. If there are multiple books, it'll go to the next book in your toolbar then continue writing it.
This was only tested this in Java but in theory, it should work on Bedrock since those books are similar.
In book.py
there are constant values above that can be used to configure it. For example, Java and Bedrock both have different maximum pages. The default is 100 pages. If you're wanting to use it in Bedrock, this has to be changed to 50. There are also some servers that limit it to a lower value.