There’s nothing special with Hugo frontmatter. And there’s no official way to utilize a python library from hugo. So
Your question asked is a generic one. So a pyhthon forum might be a better choice to ask
If you have a specific Use case/problem for Hugo please elaborate.
Btw easily found with first hit: python-frontmatter · PyPI