We created a sample program for analyzing TEI/XML files with Python.
You can use it from the following Google Colab notebook:
https://colab.research.google.com/drive/1fji80KZW8typjJMi01fyUWjrdYrNldsK

We hope this serves as a useful reference for those considering the utilization of TEI data.