[IPython-dev] Using the IPython API to configure profiles
doug.blank at gmail.com
Tue Feb 25 07:55:01 EST 2014
On Tue, Feb 25, 2014 at 7:35 AM, Clare Sloggett <claresloggett at gmail.com>wrote:
> Hi all,
> I'm new to this list so please let me know if it's not a good right place
> for this question, etc.
> I'm wondering if it's possible to use the IPython API to generate ipython
> profile configuration files, and if so, where I can find some guidance on
> doing this.
> The motivation is: I'm using python to automate some setup of ipython
> notebook. I can use python to call the shell with "ipython profile create
> nbserver" and then to edit the resulting ipython_config.py file. However
> since I'm in python already, this seems roundabout - is it possible to just
> use the IPython API directly to do these things?
> I've found the API reference at
> http://ipython.org/ipython-doc/stable/api/index.html .
> I haven't found any tutorials or guides on using the IPython API, so I'm
> just hunting through the reference, and maybe this is why I'm having
> trouble working out the right way to approach this task. Is creating an
> ipython profile, and configuring it, a sensible thing to do using the API,
> and if so, can anyone give me some pointers?
> So far I have found a way (maybe not the best way?) to create a new
> profile directory
> using IPython.core.profiledir.ProfileDir.create_profile_dir_by_name(), but
> I haven't discovered any good way to handle configuration.
> Thanks in advance!
As a new user of IPython, I can't answer your question. But we just did
this same task with our non-Python, external kernel. Here is what we are
doing: we added a flag to our program (calico --create-profile) that will
create an IPython profile. The main iprofile_config.py only needed a couple
of options (c.KernelManager.kernel_cmd) and so we create that file
directly. We also recursively copy from a setup directory to the ($ipython
locate)/profile_calico/ directory, so that if we ever want to have custom
files, we can just drop them into our setup directory, and they'll get
copied over when you --create-profile.
> IPython-dev mailing list
> IPython-dev at scipy.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the IPython-dev