python-decouple icon indicating copy to clipboard operation
python-decouple copied to clipboard

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

Open devxpy opened this issue 5 years ago • 4 comments

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!

devxpy avatar Sep 25 '18 19:09 devxpy

This is interesting. I definitely want to add this.

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

henriquebastos avatar Nov 14 '19 04:11 henriquebastos

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?

devxpy avatar Nov 14 '19 10:11 devxpy

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.

d3prof3t avatar Jan 31 '20 12:01 d3prof3t

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

henriquebastos avatar Feb 06 '20 17:02 henriquebastos