I am looking to create a gridded DTM/DEM (Digital Terrain/Elevation Model) or TIN (Triangulated Irregular Network) from a set of contours. There are a number of similar questions on both this site and elsewhere, but they all use ArcGIS, GRASS, or QGIS. I wish to perform this operation from either the command line and/or a Python script, and I do not want to install a GIS system to do it.
I'm looking for an output in USGS DEM format. The input files have a number of different variations, such as SHP LineString with 'height' specified as a data field (ie. in the DBF file); SHP LineString with 'height' specified on the SHP z attribute; and an archaic text format that will probably need a Python script to read and/or convert. Hence the inclusion of Python as a calling method.
GDAL looked promising, but it looks like it can only create rasters from point data, and not contour data - this can create interpolation artifacts if the contours are 'forced' as input data points.