From Wikipedia: a grimoire is a book of magical knowledge written between the late-medieval period and the 18th century. Such books contain astrological correspondences, lists of angels and demons, directions on casting charms and spells, on mixing medicines, summoning unearthly entities, and making talismans.

The word grimoire is from the Old French gramaire, and is from the same root as "grammar". This is partly because, in the mid-late Middle Ages, Latin "grammars" (books on Latin syntax and diction) were foundational to school and university education, as controlled by the Church — while to the illiterate majority, non-ecclesiastical books were suspect as magic. But "grammar" also denoted, to literate and illiterate alike, a book of basic instruction.