HBNetwork / python-decouple

Strict separation of config from code.
MIT License
2.81k stars 194 forks source link

[Feature Request] Port find_dotenv() feature from python-dotenv #69

Open devxpy opened 6 years ago

devxpy commented 6 years ago

python-dotenv has a feature called find_dotenv(), which -

will try to find a .env file by (a) guessing where to start using file or the working directory -- allowing this to work in non-file contexts such as IPython notebooks and the REPL, and then (b) walking up the directory tree looking for the specified file

This is specially useful for zipapps made using shiv. I don't want to package my sensitve info inside the zipapp, but python-decouple can't find my .env when I run the zipapp, because it only looks at the __file__, not current directory. (correct me if i'm wrong)

Thanks!

henriquebastos commented 4 years ago

This is interesting. I definitely want to add this.

Ref: https://github.com/theskumar/python-dotenv/blob/master/src/dotenv/main.py#L231

devxpy commented 4 years ago

Hey, that's good to hear!

On the UX side, would you prefer including this as an improvement over the regular .env finder in this project, or as a separate function, like in python-dotenv?

d3prof3t commented 4 years ago

Hey @henriquebastos

Is this feature request still in the pipeline? Would love if this is added. If not, then maybe I can have a go at this if nobody has picked up.

henriquebastos commented 4 years ago

Go ahead @d3prof3t. I'm still too busy changing diapers and chasing my daughter. 😅