Over a thousand years later and Scheherazade's story is being told. But this time, instead of 11th century Baghdad we have Portugal and instead of pages it is the silver screen at Cannes Film Festival.

Inspired by the narrative structure of the book, Portuguese director Miguel Gomes used the allegorical tales of "A Thousand and One Nights" to tell the story of the Portuguese financial crisis, focusing the crux of his story in 2013 and 2014. Categorically saying that the film is not an adaptation of the Middle Eastern tale, Gomes uses the fables for their story-within-a-story structure, with a modern day Sheherazade linking together disparate tales.

“My connection with Arabian Nights was the possibility and desire to have a very surreal film,” Gomes told The National . “In the first volume there is a dying mermaid, an exploding whale and a talking cockerel. You have a lot of unbelievable things."

“I thought that my compromise on the book was to be faithful to a certain feeling that comes from it,” Gomes said. “For me this is concentrated on surrealism. The first volume of the film, especially, has the same baroque structure and contains a lot of stories within stories within stories."

In typical Arabian Nights fashion – some versions of the book run over 600 pages – Gomes split the film into three features: The Restless One, The Desolate One and The Enchanted One. Originally charged with making a movie that ran less than three hours, Gomes ended up making three features that total six-and-a-half hours.

"It’s a challenge, I know, but I see it like a soap opera running during the festival, something you can watch and come back to,” the director told Variety . “Also it matches the form of the real Arabian Nights, where Scheherazade interrupts her story every night to create the desire to hear it the following night.”

By riffing on the Arabian Nights, Gomes puts himself in a long list of artists that have come before – from Goethe and Gustave Flaubert to Elias Khoury, Salman Rushdie and Jorge Luis Borges. Even Naguib Mahfouz was said to imitate part of them.

"Arabian Nights" have received a lot of critical acclaim, with Variety calling them "the most stirring, stimulating works at this year’s Cannes fest." And although we doubt that it will end up as being commercially popular as Disney's "Aladdin," which is perhaps the most-famous adaptation of the fables, we can't wait to see the films in theaters.