Photoshop's smart sharpening feature uses a mathematical operation called deconvolution inside. numpy has a deconvolve() function, which can probably be pressed to serve this task, but I could not find a ready-made function for smart sharpening using numpy , so you probably have to code it yourself.
An alternative approach would be to do this using GIMP. There's a GIMP plugin (intuitively named "G'Mic") that will perform deconvolution among other sharpening algorithms, and you can automate GIMP using Python.
source share