...
http://www.portailsig.org/content/python-utilisation-des-couches-vectorielles-et-matricielles-dans-une-perspective-geologique- (it is in French, you may need to use google translate)
INPUT
- 2d line shapfile contains the line string (e.g. river)
- DEM data (or any rater data with variable)
- interval of length
OUPUT
- csv data with two columns (length, elevation (or variable))
- example profile chart