I am developing a python library and the end-user who uses my library in their respective application should be able to provide a configuration file in the root path of their application which my library will read in run-time. The end-user's application can be any Project like a Simple Python Project, Django, Flask etc
In my library, I'm planning to have the following code. The following is a piece of code that will be exported as a library. for example, my-library
def read_config():
BASE_DIR = # Some code
with open(os.path.join(BASE_DIR, 'test.conf')) as f:
f.read()
I'm not sure how to get the value of BASE_DIR of the end-user's application through my library
I have seen some posts related to getting root path using settings.py which resides in the root path of the application. But in my case since I have no idea about end user's project structure, I guess I cannot use this.
Note-The enduser would install my library as a package using pip install my-library