I'm using Python 3.6, and I have a global settings file built using a Python dotenv library.
I'd like to import this file as needed in various nested packages and directories. Note that I don't mean proper subpackages, since in most cases these are independent modules. Here's the directory structure with an explanation of the contents:
app/ # Flask app (a package)
db/ # Database setup via Alembic (contains a package)
shovel/ # Python tasks via Shovel library (not a package)
scripts/ # Misc Python scripts (not a package)
settings.py # Settings file
I know I could do something like this to import the file by its path, but it seems incredibly clunky and improper to do that across umpteen files.