Tuesday’s special election in Harlem for a City Council seat offers a nice snapshot of local politics — or maybe an ugly snapshot.

The seat opened up when Inez Dickens won election to the state Assembly — neatly finding a new job before term limits left her unemployed. Mayor de Blasio opted to set the date for the election to replace her for Feb. 14 — Valentine’s Day.

Guess he’d rather lovers not be voters? Special elections always see low turnout, but the mayor plainly figured the hacks should really have an advantage on this one. Still, nine candidates qualified for the ballot.

Dickens and the Harlem old guard back Larry Scott Blackmon, an exec with FreshDirect.

And that backing has already helped him big-time: The Board of Elections overruled its own legal staff to let Blackmon run on the “Harlem Family” line — even though that’s clearly an effort to make it seem like he’s got a Working Families Party endorsement.

But it’s no guarantee — because state Sen. Bill Perkins also has his hat in the ring, looking to reclaim a seat he once held.

Why? Well, a council job means no more commuting to Albany, and he’s close enough to retiring that the eight-year term limit isn’t an issue.

And the Senate seat doesn’t pay nearly as much — not since the City Council voted itself that hefty $36,000 pay hike last year, to $148,500. He’d boost his pension, too.

So it’s the machine vs. a veteran of machine politics. As one veteran Harlem politics watcher remarks, “This switcheroo has got to stop.” Maybe the other seven candidates will matter.

One is Cordell Cleare, Perkins’ longtime chief of staff, who reportedly fell out with him over this race. Another is Marvin Holland, the Transport Workers Union political director — who might have help from state Sen. Adriano Espaillat’s own machine, since the TWU backed Espaillat in last year’s House primary.

Then there’s Dawn Simmons. A Republican, she’d seem to have no chance in a Harlem race — but she’s got deep community roots, and she’s also running on the Rent Is Too Damn High line, with the support of Jimmy McMillan himself.

And, while many of the candidates talk nicely about charter schools — which have grown increasingly popular in Harlem — Simmons is the only one you can be sure means it.

Harlem faces major strains these days — gentrification is pushing up rents and pushing people out, while the clubhouse politicos stay focused on their old wars. Nor are the neighborhood’s newer residents likely to feel any loyalty to the old machines.

A Valentine’s Day vote likely means one machine or another will triumph — but a surprise would be lovely.