everythingme / click-config Goto Github PK
View Code? Open in Web Editor NEWConfig parsing for click cli applications
License: Other
Config parsing for click cli applications
License: Other
Thanks for already supporting multiple configuration formats.
Also suppoting TOML would be a huge gain as it is a very clean format and its adoption is growing fast.
Hey there,
first of all thank you for this project. It comes down to a really nice solution overall.
Unfortunately I have 2 minor issues with it.
While I agree that debug logging would be nice here, simply printing to stdout is kind of annoying. I'd like to have control over my application output without resorting to monkey patching your project. Using python logging would solve this easily
import logging
notify = logging.getLogger(__package__).debug
Would be the easiest solution here.
It would be nice to be able to set defaults for the configuration directory. E.g. I like to configure my projects from ~/.config/${PACKAGE}/config.{ini,yaml,cfg}
.
Click comes with the get_app_dir()
function which would make this really comfortable.
My current workaround is to set the environment variable
if not os.environ.get('CONF'):
os.environ.update(CONF=click.get_app_dir(__package__))
Your type specification for the conf option gets in the way here, as exists
is set to True and thus the directory needs to be created for this to work. It might be a good idea to make this behaviour configurable as well.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.