Grading President Trump’s first year in office is all the media rage. But let’s look at the other side of the story — and grade the media.

F for effort, F for result and F for the lack of honesty.

That’s not a blanket condemnation of every journalist at every news organization. There are many hardworking professionals who try to get the facts right and keep their opinions to themselves.

But few of those people cover the White House and almost none have prominent roles at The New York Times, The Washington Post, the broadcast networks, MSNBC, CNN, NPR and The AP.

Those are the bell cows of the liberal national media, and their coverage is relentlessly anti-Trump. Day after mind-numbing day, every story is a negative opinion.

O'Keefe accused mainstream journalists of “groupthink,” saying they “move in packs . . . like blackbirds on a telephone wire. They’re all talking about the same thing.”

There is, of course, nothing new about the pattern. Media bias during Trump’s first year in office is a continuation of the bias that exploded during the 2016 campaign.

The press tried to defeat him then and now is trying to hobble his presidency if not drive him from office. The real scandal is that nothing has changed.

The Get Trump mob reached parody levels last week when the White House doctor declared him in excellent health, physically and cognitively. That wasn’t the answer the press corps wanted, so it badgered Dr. Ronny Jackson, a decorated naval admiral and the physician who examined the president.

Jackson, who was White House physician under ­Barack Obama, gave no ground. Yet both the New York Times and CNN nonetheless declared that Trump suffers from heart disease.

Notably, both organizations previously featured shrinks declaring Trump mentally unfit, too. Who needs real exams when liberals are willing to exploit their medical credentials to give politicized diagnoses from afar?

Trump, of course, is a blunt instrument and he celebrated his one-year anniversary by hitting back. His Fake News awards — Fakies, a wag called them — singled out the worst of the worst, leading with Times Op-Ed columnist Paul Krugman.

The Nobel economist foolishly wrote on election night that the stock market would “never” recover from Trump’s victory. You can’t be more wrong than that, yet Krugman shows no shame in continually predicting doom.

The collapse of journalism as we knew it, and the lack of any sign of a return to traditional standards, explains why I found myself in an unfamiliar setting last week. It was the book launch of “American Pravda,” the latest work by James O’Keefe, the founder of Project Veritas.

A self-described “guerilla journalist,” O’Keefe and his team use disguises and false identities to secretly videotape people in hopes they will admit breaking the law or abusing their power.

His targets include government and media officials as well as Planned Parenthood, ACORN, political organizations, elections officials and Twitter.

He has had success and a number of people caught in his stings have resigned or been fired. But his video editing has come under fire for being deceptive, he’s been sued repeatedly, including by New York and California attorneys general, and pled guilty to a federal misdemeanor for entering the office of a Louisiana senator disguised as a telephone repairman. He was sentenced to probation and a fine.

O’Keefe’s track record is actually pretty good, but his reputation has been battered because journalism organizations don’t regard him as a journalist because he uses deception.

That prohibition was part of my training at the Times years ago, which is why I stayed clear of O’Keefe. Until now.

Part of my changing view is that O’Keefe, despite his mistakes, has revealed evidence of serious wrongdoing and unethical behavior that no one else did or would.

Most recently, for example, he captured current and former Twitter managers admitting they use “shadowbans,” which effectively hide a user’s tweets, based on content, without notifying the user.

Other personnel admitted the company tracks user behavior and reads direct messages to find prohibited content.

Those are troubling revelations, yet most media coverage bought the company’s claims that the videos amounted to little or nothing.

That gets me to another reason for my changing view of O’Keefe — the reprehensible conduct of so-called legitimate news organizations. They, too, are guilty of deception by pretending to offer straight news when they function more like propaganda outlets for the Democratic Party.

O’Keefe’s deception is not materially different from theirs. In fact, he’s more honest, admitting he has a conservative agenda to expose the lies of powerful liberal organizations.

Moreover, as O’Keefe stressed at his well-attended book launch, many of the celebrated muckraking journalists of the early 20th century went undercover to expose social horrors. “We’re doing what people used to do,” he said, adding his book is about “what went wrong in journalism.”

His 20-minute talk was both rambling and heartening. The 33-year-old Eagle Scout from New Jersey cited George Orwell, Abbie Hoffman and Noam Chomsky, saluted the late Andrew Breitbart and said Jeff Sessions, now attorney general, once praised him by saying, “you confirm suspicions.”

O’Keefe said his nonprofit organization has a “synergy” with Trump, who made a $10,000 donation in 2015, in that both are out to expose fake news.

“What is journalism?” he asked. “It’s not an identity, it’s an activity. You are what you do.”

He accused mainstream journalists of “groupthink,” saying they “move in packs . . . like blackbirds on a telephone wire. They’re all talking about the same thing.”

His goal is to “dent the fortress and crack the dam” so the public knows who is abusing power.

O’Keefe has a passion for gathering facts and sharing them that recalls the best journalists I have known. And he is right that journalism history was written by people who went undercover to expose scandals.

Upton Sinclair, whom he cited, lived and dressed like a worker, even carrying a lunch pail, to fit in with the men who toiled in “The Jungle,” his takedown of Chicago’s meatpacking industry.

And Nellie Bly feigned mental illness so she could become a patient and expose the horrors of a New York lunatic asylum for women on what is now Roosevelt Island.

O’Keefe is in that mold. Smart, committed and fearless, he’s a modern muckraker worth watching.

To read more Michael Goodwin on the New York Post click here.