Re: Using traitlets.config outside of IPython
Thomas Kluyver <[email protected]> Wed, 25 Jan 2017 16:24:24 +0000
| Newsgroups | gmane.comp.python.ipython.devel |
|---|---|
| Message-ID | <CAOvn4qgsdzH+sxF++2yKDb5nAXVj0-8PhiOVbeKL69Sdd-mhtA@mail.gmail.com> |
On 25 January 2017 at 16:04, G Jones <[email protected]> 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 _______________________________________________ IPython-dev mailing list [email protected] https://mail.scipy.org/mailman/listinfo/ipython-dev