<P> The Tripitakas were composed between about 500 BCE to about the start of the common era , likely written down for the first time in the 1st century BCE . The Dipavamsa states that during the reign of Valagamba of Anuradhapura ( 29 -- 17 BCE ) the monks who had previously remembered the Tipitaka and its commentary orally now wrote them down in books , because of the threat posed by famine and war . The Mahavamsa also refers briefly to the writing down of the canon and the commentaries at this time . Each Buddhist sub-tradition had its own Tripitaka for its monasteries , written by its sangha , each set consisting of 32 books , in three parts or baskets of teachings : ( 1 ) the basket of expected discipline from monks ( Vinaya Piṭaka ) , ( 2 ) basket of discourse ( Sūtra Piṭaka , Nikayas ) , and ( 3 ) basket of special doctrine ( Abhidharma Piṭaka ) . The structure , the code of conduct and moral virtues in the Vinaya basket particularly , have similarities to some of the surviving Dharmasutra texts of Hinduism . Much of the surviving Tripitaka literature is in Pali , with some in Sanskrit as well as other local Asian languages . </P>
name the books in which the rules made for the buddhist sangha were written down
The Tripitakas