Introducing Unity PyPi Lens

So I wanted to try my hand at some Unity Lens writing again (the first time being unity-lens-vm).  After thinking all day Sunday for what kind of lens I wanted, I eventually came up with a lens for PyPi.  For those that don’t know, PyPi is the python package index, which allows users to find and install almost any python module.  You can search either on the site (http://pypi.python.org) or by using pip search.

Now, instead of going through all that trouble, you can simply search for available or installed modules from the Unity Dash.  One thing that I was particularly concerned about was speed, especially with the slow pypi site, and ‘pip search simple’ taking 6 seconds on my machine.  To do this as quickly as possible, I pull the list of modules from a pypi mirror (http://g.pypi.python.org/simple/) and perform the searching myself.  To make it even quicker, the data is only pulled from the web on the first search ( the first search of each unity session), and then re-used.  Again due to speed, the results are limited to 100 results, as this is about searching more than browsing.  Clicking on a result will open it’s description page on PyPi.

Check out the lens in action!

pypi from chris wayne on Vimeo.

Unity-lens-pypi was written using Quickly and Singlet, on Ubuntu 12.04.  It is available in ppa:scopes-packagers/ppa.

I’m actually quite proud of this lens, as I find it more useful than pip search or using the site.  It’s certainly faster in most cases.

To install the lens:

 

 

Posted in Uncategorized Tagged , .

3 Comments

  1. Keller Scholl October 8, 2012 at 1:36 am #

    Just installed. Got warnings saying to file a bug report. I wasn’t sure where to file it, so everything from the command line is at http://openetherpad.org/jijpVAxmk5 . Thank you for making this. It looks very cool.

    • cwayne October 8, 2012 at 5:23 pm #

      Hmm, I’ve seen that as well, but it seems to be unrelated. Is the lens working for you?

  2. Steve October 10, 2012 at 1:31 pm #

    This lens is bad-ass – nice!

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*

You may use these HTML tags and attributes <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">