[IPython-dev] Request: IPython.ext namespace

Takafumi Arakaki aka.tkf at gmail.com
Thu Oct 25 15:28:27 EDT 2012


I think IPython should provide namespace for IPython extensions, so
that extension authors can upload their extensions to PyPI.  I don't
care about what the actual name is (probably it can be ipythonext,
IPythonContrib, IPython.extensions, or what ever).  It is something
what Sphinx does for "sphinxcontrib.*" namespace.  I can think of many
reasons why it is better for IPython extension users and authors:

1. When you want to use external Python module in your extension,
   currently there is no easy way to install it.  If you can upload
   your extension as `IPython.ext.YOUREXT`, it can be easily solved.

2. Similarity, you can depends on other IPython extensions.  Currently
   there is no easy way to import other IPython extensions.

3. It does not stop people using `%install_ext`.  If your extension is
   just one file, you can just do::


4. You get IPython extension search engine for free.  People can just do::

     pip search IPython.ext

   Try ``pip search sphinxcontrib``, for example.

5. It helps people avoiding namespace collision.  Currently there is
   no easy way to make sure if other people not using some name.
   Sure, you can google it, but you can't be 100% sure.

6. IPython don't need to create any machinery for this.  All you need
   to do is to put some notice in the documentation for extension

To be fair, I will try to think the reasons why you should not do this:

1. It may drive lazy people away from writing it.  "Oh, I need setup.py
   for IPython extension?  No... I won't upload it hen."

   (But you don't need to upload your extension to pypi, if your
   extension is just one file.)

2. It increases the amount and complexity of documentation you need to
   maintain.  You need to explain:  "You can install extensions using
   `pip` (or `easy_install`, if you want).  Oh, you can use
   `%install_ext` magic by the way.  But it cannot be used for some
   packages blah blah blah...".

BTW, should I post something like this in ML or github issue?  As
there was old discussion in this ML [1]_, I am posting it here.

.. [1] http://mail.scipy.org/pipermail/ipython-dev/2012-June/thread.html#9427

Takafumi Arakaki

More information about the IPython-dev mailing list