STANFORD, Calif. — Who knew the Swedish jury that awards the Nobel prize for literature had this kind of moxie? To honor Bob Dylan’s poetic lyrics in this most phantasmagorical of American election years is a triumph of timing and substance that deserves to be hailed itself.

For Dylan is not just a wordsmith or an icon of pop culture. He is also a keen analyst of American political behavior, even if he often describes that behavior in less direct fashion than those of us who work in journalistic prose. For years I have been jotting down phrases from his songs that deftly capture our politicians and our increasingly out-of-kilter politics.

How could he have anticipated back in 1966 with his “Stuck Inside of Mobile with the Memphis Blues Again” that we would at this point have a bombastic Republican presidential nominee who would arrive “with 20 pounds of headlines stapled to his chest”?

That same song seems to me, as I listen to it on an iPod while working out, to have also anticipated that moment in 2008 when another GOP nominee, Sen. John McCain, called a White House meeting on the faltering U.S. economy and showed up with nothing to suggest, sealing his loss to President Obama.

“Grandpa died last week . . . ” Dylan sings, continuing: “I knew he had lost control when he built a fire on Main Street and shot it full of holes.”

And I would guess that Dylan speaks for much of the American electorate this year with these words from that same song:

“An’ here I sit so patiently waiting to find out what price / you have to pay to get out of going through all these things twice.”

Ten years before Donald Trump built a campaign by denouncing the “false song of globalization,” Dylan sang this in “Workingman’s Blues #2”:

The buying power of the

proletariat’s gone down

Money’s gettin’ shallow and weak …

They say low wages are a reality

If we want to compete abroad …

Well they burned my barn, they stole my horse

I can’t save a dime …

The Swedish academy rightly situated Dylan’s work in “the great American song tradition.” The Nobel announcement inspired Stanford University’s radio station on Thursday to play a collection of Dylan and Dylanesque songs, including one I had never heard before. Written and recorded in 1995 by Bob Franke, “Kristallnacht Is Coming” foreshadowed in apocalyptic terms this election year’s ugly discussion about immigration. It begins with a German woman talking to a Californian about the antecedents of the Holocaust:

We never wanted to kill Jews, we just wanted them away.

And you know we gave them lots of time until Kristallnacht sealed their fate; We only wanted them to emigrate …

Kristallnacht is coming, little Mexican child,

The night of breaking glass, the night of running wild;

Run in the streets until Kristallnacht seals your fate,

We only wanted you to emigrate.

I can’t imagine even in my worst nightmare that this song could have the power of prophesy. But the Swedish Nobel jury has performed a service for us all in getting us to focus on the stark — at times grim but insightful — poetry of Bob Dylan and others working in the great American song tradition.

Jim Hoagland is a contributing editor for The Post and a visiting fellow at Stanford’s Hoover Institution.