Code Monkey home page Code Monkey logo

click-config's People

Contributors

arikfr avatar bergundy avatar msabramo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

click-config's Issues

Support TOML

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.

notify function and conf defaults

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.

The notify function

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.

Config defaults

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.