John Cunliffe reading a Postman Pat story to children at a library in Leeds in 2003.
Photograph: Yorkshire Post/SWNS

John Cunliffe, who has died aged 85, said he was inspired to create Postman Pat by his work for Wooler mobile library in Northumberland. “Like Pat, I travelled around a rural area and met a great many farmers and other rural dwellers who were kind and generous in the way that the people of Greendale are,” he recalled. “It was all there, in my memory.”

Kindness and generosity, together with selflessness and community spirit, were virtues worth celebrating in the autumn of 1981 as the prime minister, Margaret Thatcher, entered her second year in office. In the first episode, Postman Pat’s Finding Day, its hero was tasked with delivering birthday parcels to the twins Katie and Tom Pottage. So Pat set off in his red Royal Mail van (licence plate: PAT1) with his black and white cat, Jess, in the passenger seat. This was decades before the Royal Mail sell-off and long before British streets became clogged with rival FedEx, UPS and Amazon vans.

After delivering the presents, Pat discovered Katie tearful over losing her doll, Sarah-Anne. So he undertook to look for the doll on his route. Maybe she had left it in the church, suggested Reverend Timms; he and Pat scoured the pews, only to find Dorothy Thompson’s missing glove, which Pat returned to Ms Thompson – who in turn found Ted Glenn’s knife, which Pat returned to Mr Glenn, who found Miss Hubbard’s watch. After Pat had returned all this lost property, he decided to buy chocolates from Sam’s mobile shop for Katie, to cheer her up. Behind the chocolate box on the shelf he found the doll. Order was restored and Pat got a slice of birthday cake as a reward.

Many of the 196 episodes of Postman Pat were similarly fond depictions of a community-spirited world that seemed to be fast disappearing. As a result, Cunliffe’s creation became hugely popular worldwide: the television programmes were broadcast in 55 countries and more than 12m books were sold. Prince William carried Pat’s thermos flask to school.

Before being broadcast in Japan, the usually four-fingered Postman Pat puppet was given an extra finger so he did not resemble a member of the local Yakuza crime organisation, who sometimes have their digits cut off as an act of internal discipline. There were even satires: in Harry Enfield and Chums, for instance, the action was moved to Italy, the theme song reworked as opera and at the end a communist revolution in Greendale ends with Pat being shot by fascist soldiers.

Pat McCarthy, a postman in the Scottish Highlands, who had a black and white cat called Roguey, was long believed by locals in Arisaig to be the inspiration for Postman Pat, but he wasn’t. Cunliffe called his character Pat because it “sounded nice”, adding: “It’s lovely when people identify with the series, but there’s no connection. There are a lot of postmen called Pat and a lot of black and white cats.” He was also frequently asked whether a pet cat could, in fact, ride loose in a Royal Mail van. Probably not, he reflected.

Postman Pat came about in 1978 when Cunliffe was teaching at Castle Park primary school in Kendal, Cumbria. A parent of one of the schoolchildren, who knew that he wrote children’s books, said to him: “I heard a talk last night, given by a lady from the BBC. She said they were looking for new writers, for a new TV series. Why don’t you send her some of your books?” He did, and then met the BBC children’s TV producer Cynthia Felgate, who was looking for a new series for preschool children, set in the countryside. “What about having a postman as the central character?” he asked.

Cunliffe brought Postman Pat to life on a black Triumph typewriter in the back bedroom of his house in Kendal. Initially he wrote 13 stories and drew a map of his fictional village of Greendale, modelled on Longsleddale, a few miles from his home. His mother-in-law was the template for Mrs Thompson at Greendale Farm, and the phone book gave him other names.

He also strolled down to No 10 Greendale, the local post office, to do research vital for the creation of his fictional postmistress, Mrs Goggins. The real-life post office closed in 2003 but there is now a commemorative plaque outside to Cunliffe and his creation.

At the time he created Pat, Cunliffe was lonely. His only child, Edward, was at boarding school and his wife, Sylvia (nee Thompson), was living miles away as a mature university student. Populating Greendale with happy people was a comfort. But, as he told Nick Davies of the Guardian in 1994, there was another reason. As a boy at school in the Lancashire mill town of Colne he had been a punchbag for bullies. So when he wrote about his jovial country postman, Cunliffe was constructing a community where everyone was happy and no bullies broke anybody else’s spectacles.

The BBC liked the stories and showed them to the animator Ivor Wood, who had made The Magic Roundabout, The Herbs, The Wombles and Paddington Bear. Wood agreed to turn Cunliffe’s stories into 15-minute films for the BBC. Progess was slow – an animator on Postman Pat completed about 10 seconds of footage each day.

Cunliffe sold the rights to Wood’s company, Woodland Animations, but was disappointed by the tie-in merchandise that was later released, which he thought was tacky and too commercial. Woodland licensed nearly 600 products including socks, pyjamas, jogging suits, cycle shorts and swimming trunks. It also distributed literature in which it described itself as “the originators of the famous television, video and book character”; at an awards ceremony when the show won a Golden Cassette for record-breaking sales of audio tapes, Wood, rather than Cunliffe, was praised as Pat’s creator.

Cunliffe did not fight back. “Life’s too short for wrangles,” he said. “On to the next exciting project!” That was called Rosie and Jim, a television series about two rag dolls who live on a Birmingham canal boat and come alive when no one is looking. The series was broadcast between 1990 and 2000 on ITV, and this time Cunliffe’s contribution was demonstrable. He appeared in the first 50 episodes, playing the boat’s first owner, a bearded chap called Fizzgog.

Cunliffe was born in Colne. He told interviewers that his father disappeared around the time he was born. His mother, a shop worker, could barely earn enough to keep them in food and clothes, so they had to board with his aunt and uncle. It was Uncle Herbert who introduced him to books, telling him about Shakespeare and Dickens and the wonderful universe of the imagination where life could be whatever you wanted it to be.

It was a universe into which Cunliffe often retreated. He worked first as a librarian and then as a teacher, and his first book, Farmer Barnes Buys a Pig, was published in 1964. In all he wrote about 190 books for children, including picture books and five volumes of poetry. He also wrote a play, The Twelve Days of Christmas, that was staged by Hull Truck Theatre in 1997. In 2010 he released Ghosts, a children’s story for the iPad, and 2014 saw a movie version of Postman Pat.

Cunliffe spent his later life in Ilkley, West Yorkshire, and is survived by Sylvia and Edward.

• John Arthur Cunliffe, author, born 16 June 1933; died 20 September 2018