Get Package Name

The “Package Name” is tightly coupled to the previous function related to the PYTHONPATH. The package is defined to be contained within an directory entry from the sys.path variable [Object-Namebinding]:

1
<package>

The call signature is [Filesystem Binding Functions]:

1
get<obj>_package_filename

Where <obj> is resolved to one of:

  • Caller

  • Frame

  • Module

E.g. in case of an Caller by the relative stack position [API]:

fileinfo.getcaller_package_filename