Neil Gaiman is to start work "in a couple of weeks" on adapting his bestselling novel American Gods into a TV series for the American cable channel HBO.

Speaking at the Guardian Book Club at the Edinburgh international book festival, the author said: "I got the email yesterday saying that the final contractual tos and fros have been sorted out and I should be free within a couple of weeks to start writing."

Gaiman, 50, is the British-born, US-based novelist, short-story writer and screenwriter widely regarded as having redefined the graphic novel, notably with his comic book series The Sandman.

His first "straight" novel, Neverwhere, was a version of his 1996 BBC screenplay of the same name. American Gods is his bestselling novel which, on the 10th anniversary of its publication this year, was re-published with an extra 12,000 words of material that had been excised from the first edition.

He is planning a full-scale sequel to the book and, he said, "at least two" shorter spin-offs featuring the story's main character, Shadow.

Robert Richardson will make his directorial debut with the HBO series. As a cinematographer, the double Oscar-winner has worked on the Quentin Tarantino films Kill Bill and Inglourious Basterds, and on Martin Scorsese's Shutter Island.

"He loves it, he has all these great, mad ideas," said Gaiman. "Having fallen in love with it while other people fell by the wayside, he stayed with it." Gaiman plans to write the pilot, the last episode and maybe some in the middle.

Tom Hanks's production company, Playtone, is to produce the show. Gaiman said he hoped the makers would remain faithful to the book.

"They've made a lot of series for HBO and they seem really smart and they love it for what it is and don't want to soften it.

American Gods is based on the premise that the gods of ancient mythology exist in present-day America and are kept alive by people's belief in them.

Gaiman said: "The joy of writing a novel like this is being able to take something you could see as a metaphor and making it real. For me the result was all these down-at-heel gods scrabbling for what little belief they could get and pumping gas or working as small-town plumbers in a desperate effort to keep their heads above water."

He said the story would make a better TV series than a film. "Over the years I've had phone calls from major directors or major actors. They say, 'I want to make it into a movie,' and I say, 'Great. How?' And at that point I would always have to apologise for the fact that I wrote it while I was doing a couple of screenplays, and was incredibly grumpy at the idea of doing 124-page stories with beginnings, middles and ends and was determined that the novel should be formless and would have lots of ends, and several beginnings, and middles all over the place. So I actually like the idea that HBO are doing it.

"The stuff that I had the most concern about going in, because it's the stuff that America has the most keenness to jettison, is the racial aspect of things," he said.

Speaking of possible casting for Shadow, he said: "Shadow is of mixed race and I wanted to find an actor who has that thing going. An actor who turned up after American Gods was written and, if he hadn't have become huge would have been perfect, was Dwayne 'the Rock' Johnson because he has this huge bulk, and doesn't look terribly smart – which is one of the fun things about Shadow: he's smarter than people assume.

"I want to keep races and nationalities. I don't want it to become softened and homogenised, and I want it to be prickly," he said.