It is said there is no such thing as bad publicity, but even a pathological attention-seeker like Tommy Sheridan may now be disputing that one.

I, Tommy, a theatrical depiction of the former Scottish Socialist Party convener's life that opened at the Edinburgh Festival Fringe on Friday, is a belittling critique of a politician whose fall from grace has been described by its writer, Ian Pattison, as the biggest political story in Scotland for years.

Pattison, best known as the creator of Rab C Nesbitt, shrewdly kept the script away from an anxious Sheridan, who will now know that the play's aim is to have the audience laughing at him rather than with him.

I, Tommy was inspired by Downfall, the scorching indictment of Sheridan's behaviour by his one-time SSP ally, Alan McCombes. The book's argument was that Sheridan became the architect of his own demise in 2004 when, as a sitting MSP, he confessed to SSP colleagues about attending the Cupids sex club in Manchester.

Instead of resigning with dignity, he took the kamikaze step of suing the News Of The World over stories about extra-marital activities he knew to be true.

He then expected colleagues to lie for him in court, and trashed them as "scabs" when they refused.

Although Sheridan won the defamation case, he was later jailed after the jury of a second trial ruled that his initial victory had been based perjured evidence.

The challenge of I, Tommy was how to squeeze two court cases and a mountain of deceit into a 90-minute play. Pattison opted for a simple formula: Des McLean, who expertly plays Sheridan, is pitted against Colin McCredie, the Taggart star who plays McCombes.

The production is dominated by the pair's exchanges and the interventions of McCombes, who acts as the wiser head offering advice that Tommy ignores.

It doesn't take long to realise how Sheridan is to be portrayed. Rather than holding him up as a great working-class fighter, Pattison depicts the former MSP as a vain, shallow and selfish creature, for whom the allure of celebrity and women are of at least equal importance to socialism.

A subtle, but brutal, tactic of I, Tommy is the way in which it undermines many of Sheridan's apparent achievements.

In 1992, he was jailed for ignoring a court order that banned him from attending a warrant sale in Glasgow. In the play, Sheridan clashes with the prison guard after his "male grooming products" have been taken off him.

The audience laughed again when Sheridan's boast that he had used his time behind bars to read Das Kapital was denied by the guard, who said he had instead been "writing letters to birds".

Even his supposedly heroic fight against the poll tax is mocked. As he informs a female admirer: "I will not mince about the bush." And so it goes on ... and on and on.

As for his strategy – sue any newspaper that writes the truth about his swinging – Sheridan insists his powers of oratory are so powerful he can talk "punters out of comas".

It is unlikely that Tommy's wife Gail, played by Michele Gallagher, will be part of any queue to see herself portrayed on stage.

Gail comes across as a superficial publicity addict who is oblivious to her husband's secret double life.

When McCombes calls Tommy about attending Cupids with his brother-in-law, Gail can be seen praying in front of Jesus: "God bless all my family."

Even kissing Tommy on her wedding day is a source of directorial sarcasm. "Make it good, the Record is watching," she says.

Friday's preview show was not without its teething problems. A few lines were fluffed, and parts of the dialogue were a little clumsy, but these were minor issues that can be overcome.

A more valid criticism is over the depth of Pattison's characterisation. By trivialising Tommy, the writer suggests his subject was a benign dafty.

In reality, Sheridan's post-2004 behaviour was much darker than the play is comfortable portraying. There is no mention, for instance, of an email sent from Sheridan's parliamentary account calling for evidence to be destroyed, and no mention of how faked minutes of the SSP executive meeting just happened to appear.

Edinburgh's audience was treated to the pathetic side of Sheridan, but his vindictive and ruthless side does not come to the surface.

Even so, Pattison should be congratulated for debunking the Sheridan myth and for shining an unforgiving spotlight on the spectacle the man has become.

As McCombes asks Tommy at the end of the play whether he regrets his actions, it is difficult not to consider what the future holds for Sheridan. The focus on the former SSP's leader's love of Z-list celebrity life may, unfortunately, be an accurate foretaste of things to come.

Sheridan could yet emerge as a regular on the mid-morning chat show circuit, reinventing himself as a Tartan version of Neil Hamilton, but with less integrity.

And this is the lesson of the play. Where once an audience would look at Tommy with admiration, the same folk are now struggling to contain their laughter.

I, Tommy accurately reflects what Sheridan has become – a punchline.