FlyingTeller's suggestion is probably optimal: the derivative of log(f) is
f'/f which is easy enough to implement:
import numpy as np
import matplotlib.pyplot as plt
from scipy.interpolate import InterpolatedUnivariateSpline
x = np.arange(1, 9)
y = np.sqrt(x) # something to use as y-values
spl = InterpolatedUnivariateSpline(x, y)
logder = lambda x: spl.derivative()(x)/spl(x) # derivative of log of spline
t = np.linspace(x.min(), x.max())
Constructing a spline based on the logarithm of data is also a reasonable approach, but it is not the same thing as the logarithm of the original spline.
if you can define a function, depending on a spline, which can be differentiated by python (analytically)
Differentiating an arbitrary function analytically is out of scope for SciPy. In the above example, I had to know that the derivative of
1/x; SciPy does not know that. SymPy is a library for symbolic math operations such as derivatives.
It's possible to use SymPy to find the derivative of a function symbolically and then turn it, using
lambdify, into a callable function that SciPy or matplotlib, etc can use.
One can also work with splines in an entirely symbolic way using SymPy but it's slow.