Archive for the 'Canopy' category

PyXLL: Deploy Python to Excel Easily

Feb 06 2014 Published by under Canopy, Enthought Canopy, Finance, News, Python, PyXLL

PyXLL Solution Home | Download PyXLL | Press Release

Today Enthought announced that it is now the worldwide distributor for PyXLL, and we’re excited to offer this key product for deploying Python models, algorithms and code to Excel. Technical teams can use the full power of Enthought Canopy, or another Python distro, and end-users can access the results in their familiar Excel environment. And it’s pretty straightforward to set up and use.

PyXLL is free for non-commercial and evaluation purposes, and in Canopy you can simply grab it from the Enthought repo via the Package Manager as shown in the screenshots below (note that at this time PyXLL is only available for Windows users). The rest of the configuration instructions are in the Quick Start portion of the documentation. PyXLL itself is a plug-in to Excel. When you start Excel, PyXLL loads into Excel and reads in Python modules that you have created for PyXLL. This makes PyXLL especially useful for organizations that want to manage their code centrally and deploy to multiple Excel users.

Enthought Canopy Package Manager   Install PyXLL from Enthought Canopy's Package Manager

To create a PyXLL Python Excel function, you use the @xl_func decorator to tell PyXLL the following function should be registered with Excel, what its argument types are, and optionally what its return type is. PyXLL also reads the function’s docstring and provides that in the Excel function description. As an example, I created a module my_pyxll_module.py and registered it with PyXLL via the PyXLL config file. In that module I put a simple function pyfib(): a naive Fibonacci implementation.

When I start Excel, I can access the Excel function wizard and find my pyfib() function and use it. The function documentation in Excel comes from my docstring. PyXLL parses the “n: integer input” portion as the variable documentation.

If I go back and make a change to the function, I can reload PyXLL without restarting Excel and update the cells. If I add another function to my module, it too will get loaded and be available to use in my worksheet.

So if you are developing Python models or functions for a large number of distributed Excel users, you can manage the code centrally. PyXLL will load new versions and new functions from the central repository whenever a user starts Excel. Deployment is very straightforward, and central management of all the code reduces the risk of Excel macros and functions proliferating uncontrolled.

I can also create menu functions using the decorator @xl_menu. PyXLL ships with several examples that you can start with. The one below adds a menu item to the Excel Add-in menu, and pops up a message box when selected.

       

As I said earlier, PyXLL is free to download for non-commercial and evaluation purposes. In Canopy it’s available in the Package Manager (as long as you upgrade to Canopy v1.3 first), and for other Python distros it’s available from our PyXLL store page. You can also find more details and documentation on the PyXLL product pages.

13 responses so far

Enthought Canopy 1.3 Released: Includes Move to Python 2.7.6

Feb 04 2014 Published by under Canopy, Enthought Canopy

Enthought Canopy Product Page | Download Enthought Canopy

Enthought Canopy 1.3 is now available and users should see the update notification in the bottom right corner of the Canopy welcome screen (as shown in the image below). This is a fairly small update primarily focused on bug fixing and stability improvement. The biggest change is the move to Python 2.7.6 from 2.7.3.

Enthought Canopy Update Available Notification
The bottom right of the Enthought Canopy window notifies users to available updates

Python 2.7.6 rolls up a couple of minor updates to the core Python environment. The most important changes from our perspective are a number of security fixes required by some users as well as fixes for Mac OS “Mavericks.” Details can be found in the Python release notes, but in general the change should be transparent to most users. The only caveat is for users building Python eggs with native C or FORTRAN extensions and publishing those eggs to users who may still be running earlier versions of Canopy or Python 2.7.3 in general. In this case, it is safest to continue building against earlier versions of Canopy.

But isn’t updating Python versions painful you may ask? In the past, yes, updating to a new Python version often required a new Python install and then re-installing all of your custom packages. However, with Canopy’s auto-update mechanism, it’s simply a matter of clicking the “Update available” link and choosing “Install and relaunch” or “Install after quit.” Canopy will automatically update the core Python installation and restart without impacting your environment. Additionally, whether you are running Canopy 1.1, 1.1.1, or 1.2, Canopy will jump straight to 1.3 and get you all of the latest updates.

We encourage all users to update to Canopy 1.3 as the 1.2 and 1.3 versions include a large number of stability fixes as well as cleaning up a lot of other less serious, but still important aspects of the user experience. For those new to Canopy, you can get Canopy here.

Enthought Canopy makes Python updates convenient
Enthought Canopy makes updates convenient with automatic downloads that install without impacting user environments

Keep up with all of the latest news from Enthought on our social media channels:  Linked In | Twitter | Google+ | Facebook | YouTube

16 responses so far

Older posts »

Featuring Advanced Search Functions plugin by YD