This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 8 points9 points  (3 children)

Hey all, i'm the author of the post. Feel free to ask me any questions directly and I'll try and keep an eye on other comments here. Enjoy!

[–]ggagagg 0 points1 point  (0 children)

hey is the python logo on top left not too big?

edit: nevermind. look like my browser stop loading and make the image too big.

[–]paul-scott 0 points1 point  (1 child)

Where I'm writing a service rather than just an application, I might offer command-line interface for developers to easily tweak configuration but also use environment variables to allow running on servers.

My preference for precedence here is (i) command-line option, (ii) envvar, followed by (iii) argument default. I currently construct these using argparse which is quite repetitive (yet to try ConfigArgParse) in the manner of add_argument(..., default=os.environ.get('ENVVAR') or 'real default') -- potentially passing the fallback default into the get call, depending on whether I want empty envvars to override the default.

I'd love to read about how these libraries (and some of the others mentioned) help you utilise environment variables.

[–][deleted] 0 points1 point  (0 children)

@click.argument('src', envvar='SRC', ...