How to get ParentPackageName of a level in Python?

I want to get this value in Python