IPython.config, HasTraits, Traitlets as an independent library?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

IPython.config, HasTraits, Traitlets as an independent library?

Robert McGibbon
Hey,

I've become convinced that IPython's traits-based configuration system
is awesome, and really useful for other
projects that have a command line app that needs to be configured,
either with command line flags or a config file. I really like how it
lets me keep my apps DRY, by automatically exposing a traitlet as a
configurable command line option without having to repeat the
docstring/helptext, and how you basically get file based configuration
in addition to command line configuration basically for free.

Are others using the IPython config system outside of the IPython
codebase itself? There's not a lot of documentation, but I think it
really beats systems like the cement framework.

I'm wondering if it makes sense to think about the config system as a
modular framework to be used by other packages as well. The logical
extension of that would be to spin it off as another repo/project that
IPython depended on, but that's a little premature. More realistic would
be to write up maybe some documentation on how to use the config system
in your own app.

-Robert
_______________________________________________
IPython-dev mailing list
[hidden email]
http://mail.scipy.org/mailman/listinfo/ipython-dev
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: IPython.config, HasTraits, Traitlets as an independent library?

Matthias Bussonnier

Le 16 avr. 2013 à 03:17, Robert McGbibbon a écrit :

Hey,

I've become convinced that IPython's traits-based configuration system
is awesome, and really useful for other
projects that have a command line app that needs to be configured,
either with command line flags or a config file. I really like how it
lets me keep my apps DRY, by automatically exposing a traitlet as a
configurable command line option without having to repeat the
docstring/helptext, and how you basically get file based configuration
in addition to command line configuration basically for free.


Are others using the IPython config system outside of the IPython
codebase itself?

Yes, nbconvert/nbconvert2 … Ok, I know it does not count. 


There's not a lot of documentation, but I think it
really beats systems like the cement framework.

I'm wondering if it makes sense to think about the config system as a
modular framework to be used by other packages as well.

I agree, but there are still some assumptions that config stuff is run from inside IPython
that should be removed before. The second things is that config file are not updatable by 
a program, they have to be edited by hand. (side effect of being pure python file)
It would be really great to have the ability to read/write form/to a plain configuration file. 
Apparently python3 is good at that. 

The logical
extension of that would be to spin it off as another repo/project that
IPython depended on, but that's a little premature. More realistic would
be to write up maybe some documentation on how to use the config system
in your own app.

IPython docs is great for that. Nbconvert2 is really small if you need a self contained example.

-- 
Matthias


-Robert
_______________________________________________
IPython-dev mailing list
[hidden email]
http://mail.scipy.org/mailman/listinfo/ipython-dev


_______________________________________________
IPython-dev mailing list
[hidden email]
http://mail.scipy.org/mailman/listinfo/ipython-dev
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: IPython.config, HasTraits, Traitlets as an independent library?

Thomas Kluyver-2
On 16 April 2013 10:24, Matthias BUSSONNIER <[hidden email]> wrote:
The second things is that config file are not updatable by 
a program, they have to be edited by hand. (side effect of being pure python file)
It would be really great to have the ability to read/write form/to a plain configuration file. 
Apparently python3 is good at that. 

The config framework does have a notion of different loaders, so it should be straightforward to add a loader for config files (or other formats like json, sqlite, etc.). It might be a bit more work to allow writing the config back to disk, but I think it's a worthwhile goal.

Thomas

_______________________________________________
IPython-dev mailing list
[hidden email]
http://mail.scipy.org/mailman/listinfo/ipython-dev
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: IPython.config, HasTraits, Traitlets as an independent library?

Stéfan van der Walt
In reply to this post by Matthias Bussonnier
On Tue, Apr 16, 2013 at 11:24 AM, Matthias BUSSONNIER
<[hidden email]> wrote:
> IPython docs is great for that. Nbconvert2 is really small if you need a
> self contained example.
> http://ipython.org/ipython-doc/stable/config/overview.html

I don't know if anyone is interested in user feedback at this stage but:

1) I just tried to run nbconvert2 (recommended by nbconvert.py), and
couldn't figure out how to do it.
2) The long option names are rather intimidating.

Stéfan
_______________________________________________
IPython-dev mailing list
[hidden email]
http://mail.scipy.org/mailman/listinfo/ipython-dev
Loading...