Is there any open source software to automatically extract information from a book: genre, style, location and time of the story, characters, etc?
This, generally speaking, corresponds to the fields of text mining, entity extraction, and automated (meta)data extraction. It's not part of linguistics per se; it's more applied linguistics with relations to information science and library science.
It's an enormously important field right now: consider, for example, the Google Books project. Google needs to be able to mine through thousands of scanned books to extract author, publisher, title, date, etc. so that it can create metadata to index the books with. They don't solely use text mining to do this, but it is one of the methods. I don't know if these methods are good enough to find genre, characters, etc., but it's a similar idea.
If you're looking for software, I suggest starting with the list of FOSS Information Extraction tools found in Wikipedia as a starting point.