Using traitlets for configuration

Viewed 59

I am interested in using traitlets in one of my tools just in order to improve configuration (clean handling of cmdline + config files, error handling, etc.). I have read the traitlets documentation and made some very simple experiments, but I am not sure about the following points:

  • How should configuration files be loaded? Are there any default configuration file locations? Any best practices / default entrypoints?
  • Should all commandline options be turned into traits? Or how could I add custom options?
  • In particular, I would need an option --config config_file.py which should load the configuration file.

I am optimistic that traitlets is a good fit for my use case, but the documentation seems to address other aspects better (how to define and observe traits, for instance). My questions might still be interesting to others.

0 Answers
Related