I have two packages:
my_tools, a series tools including functionf()my_projectwhich hasmy_toolsas a dependency and which is using itsf()function
My problem is that when I call f() from my_project package's code, I need f() to be able to find it's been called from the my_project package (and for instance return the package's name).
For example:
# my_project/code.py
from my_tools import f
print f() # prints 'my_project'
I've been playing around with sys and inspect but couldn't find any solution so far.