I saw a discussion on your first on the mailing list, so I am pretty sure there is a built in functionality it. Edit: I just looked in the demos and
h = CellSize(mesh)
will give you an estimate.
The circumscribing ellipse part is done in the pragmatic mesh generator. It is available on github, look for the mesh_metric function in python/adaptivity.py
Note that
1. the code works in 2D as well as 3D, so there is some extra complexity
2. the DG0 tensor you get out has unit of inverse squared length
3. the DG0 tensor is scaled such that the triangle/tetrahedron with unit edge length results in the identity tensor.