It doesn't really matter who wrote the words - which of course were later translated, re-written, added to, subtracted from, etc - since every single one of those words was thought of and written down by a human being. No god wrote any of it or 'inspired' anyone to write any particular words and since only a small proportion of the people were literate, the stories were transmitted to other orally.
P.S. And the word 'divinity' is meaningless since there is nothing to support it!