How to get the boundary line mesh from a 2D mesh

I created a mesh with the automatic geo.GenerateMesh on an OCCGeometry. How can I get the data of boundary meshes, which in this case would be a bunch of 1d meshes for the boundary lines? I am using the python API.