[IPython-dev] Using traitlets.config outside of IPython

Thomas Kluyver takowl at gmail.com
Wed Jan 25 11:24:24 EST 2017


On 25 January 2017 at 16:04, G Jones <glenn.caltech at gmail.com> wrote:

> I am really intrigued by the design and features of the traitlets.config
> system that IPython uses for configuration. I am considering using it for a
> project of my own, but I am not sure if it is a good fit. To help decide, I
> wanted to look to see how other projects are using it, but so far I haven't
> really found any outside of the IPython/Jupyter ecosystem. This in itself
> is a bit worrying; maybe it's too specialized to the needs of IPython? Are
> there any other projects using traitlets.config that people know of?


Traitlets is a lightweight clone of Enthought's traits package; you might
be able to find more projects using that. I think matplotlib was thinking
of using traitlets, but I don't think they were going to use the config
part.


> Any advice about using it for another project as opposed to more
> traditional yaml or ConfigParser style configuration?


The big downside of traitlets for config is that it exposes your class
names as the keys for config options, so changing the structure of classes
in later versions of your code can break people's config unless you write
compatibility shims for them.

The way we use it in Jupyter is mostly with executable .py config files.
That's convenient for users editing them by hand, but doesn't really allow
programmatic modification (e.g. if you want a GUI settings dialog). We use
JSON files for saving config from the application, but then there's a
potential source of confusion with different config files setting the same
things.

Thomas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20170125/05f7342f/attachment.html>


More information about the IPython-dev mailing list