List of modules working with ironpython - python

Is there a place that lists standard library and 3rd party modules that work with IronPython? If not, please let me know here.
Here are some I have tried:
cherrypy - works with fepy - example
comtypes: has no hope until ctypes is functional which seems far off still.
dulwich: builds after removing optional extensions from setup.py file. Imports after adding in jdhardy's zlib and subprocess modules. Seems to pass its own tests.
numpy, parts of scipy: pytools
rpyc works out of the box. Awesome library so you can remotely use cpython ojects from ironpython and vice versa

The official IronPython website has a page that lists the compatibility status of third-party libraries.
However, currently only two libraries are listed. If you're a third-party library developer and you know how well your library works with IronPython, it would be great to add it there.

pywin32 and PyODBC go away, replaced by the FCL (optionally using one of the ODBC .NET data providers if you're married to ODBC). CherryPy is pure Python and so should mostly work; I'm sure the developers would be interested in hearing about any problems. For NumPy there's Ironclad.

numpy and parts of scipy now work with ironpython: http://pytools.codeplex.com/

Related

Could I use Cython with 3rdparty pure python library?

I'm using Python to develop a commercial software.
But I don't want to offer source to my clients.
I knew that Cython can complie my code to binary.
But could I use Cython with 3rdparty pure python library(I mean those libraries written in pure Python)?
Cython compiles to .pyd (not pyc), which is basically a dll. In theory it should work with any python code, including 3rd party libraries, but there's no guarantee (see the first comment below). You'd also better check the licenses of the libraries you intend to use though, to make sure they don't prohibit distributing as closed source.
Your other option is something like cx_Freeze or py2exe, both of which I think compile to binary. I've never really inspected the files they produce though so you'll need to check up on that.

Using NLTK with Google App Engine

Is anyone using NLTK with GAE? From this thread it appears that GAE does not support NLTK (Special installation tricks needed.) Do you know any other lightweight similar Python module? Thanks.
GAE supports pretty much any "pure" Python modules which don't try to access files or sockets or other system level utilities. The poster from your link was mostly just trying to minimize the number of modules they included. They expressed a trial and error approach to figuring out which NLTK modules would be needed for their application. A slightly faster approach would be to download the whole NLTK package and move in all the ".py" files rather than just one at a time. There's no big downside to including modules you won't be using.
However this process is something of a fact of life with GAE. Any modules that aren't directly included in the GAE libraries need to be installed manually, and they need to be checked for any deviations from the GAE sandbox restrictions. See this.
A quick glance at the NLTK source code suggests that modules that depend on "mallet" in particular might be problematic, since this is compiled java code.

writing an api for python that can be installed using setup.py method

I am new at writing APIs in python, in any language for that matter. I was hoping to get pointers on how i can create an API that can be installed using setup.py method and used in other python projects. Something similar to the twitterapi.
I have already created and coded all the methods i want to include in the API. I just need to know how to implement the installation so other can use my code to leverage ideas they may have. Or if i need to format the code a certain way to facilitate installation.
I learn best with examples or tutorials.
Thanks so much.
It's worth noting that this part of python is undergoing some changes right now. It's all a bit messy. The most current overview I know of is the Hitchhiker's Guide to Packaging: http://guide.python-distribute.org/
The current state of packaging section is important: http://guide.python-distribute.org/introduction.html#current-state-of-packaging
The python packaging world is a mess (like poswald said). Here's a brief overview along with a bunch of pointers. Your basic problem (using setup.py etc.) is solved by reading the distutils guide which msw has mentioned in his comment.
Now for the dirt. The basic infrastructure of the distribution modules which is in the Python standard library is distutils referred to above. It's limited in some ways and so a series of extensions was written on top of it called setuptools. Setuptools along with actually increasing the functionality provided a command line "installer" called "easy_install".
Setuptools maintenance was not too great and so it was forked and a more active branch called "distribute" was setup and it is the preferred alternative right now. In addition to this, a replacement for easy_install named pip was created which was more modular and useful.
Now there's a huge project going which attempts to fold in all changes from distribute and stuff into a unified library that will go into the stdlib. It's tentatively called "distutils2".

Important packages and modules not compatible with py2exe?

Are there major/common/important packages that py2exe cannot handle?
I am currently studying the possibility of creating a .exe from a Python program that will use Tkinter, some Excel file reading module, NumPy, SciPy and matplotlib: is it realistic to try to achieve this with py2exe?
I routinely build py2exe single file executables using Scipy, matplotlib, wxpython and win32com or the Machin's xlrd/xlwt modules. Never used Tkinter but should not be a problem, probably wxpython is more picky.
I have found some problems with numpy/scipy, matplotlib and wxpython before and after building the executable but after you know what to do it works smoothy.
Some problems:
matplotlib requires to indicate where some auxiliary archives are. You need to add to your setup.py
datafiles = matplotlib.get_py2exe_datafiles()
numpy/scipy have given me some problems, due to some expresions in the modules, when executing the py2exe executable.
Numpy has some lines suchs as:
__doc__ += "something more"
that fail when __doc__ is None.
For this I had to modify manually the numpy scripts (including if's). I do not know if this has been solved in the new versions.
wxpython is generally a source of problems due to some required microsoft dlls that have to be present in the computer to work. Just you have to be carefull assuring you provide them in your package or at least preventing your users about the issue.
Some useful hints can also be found in the py2exe and wxpython wikis
It's realistic to try, sure. You'll probably hit a few issues but I doubt you'll reach a blocker, especially with very common packages.
You can get a quick look at how well py2exe works with various libraries here:
http://www.py2exe.org/index.cgi/WorkingWithVariousPackagesAndModules
For anything not listed there, fire off a quick google for py2exe <package-name>

Has anyone used SciPy with IronPython?

I've been able to use the standard Python modules from IronPython, but I haven't gotten SciPy to work yet. Has anyone been able to use SciPy from IronPython? What did you have to do to make it work?
Update: See Numerical computing in IronPython with Ironclad
Update: Microsoft is partnering with Enthought to make SciPy for .NET.
Some of my workmates are working on Ironclad, a project that will make extension modules for CPython work in IronPython. It's still in development, but parts of numpy, scipy and some other modules already work. You should try it out to see whether the parts of scipy you need are supported.
It's an open-source project, so if you're interested you could even help. In any case, some feedback about what you're trying to do and what parts we should look at next is helpful too.
Anything with components written in C (for example NumPy, which is a component of SciPy) will not work on IronPython as the external language interface works differently. Any C language component will probably not work unless it has been explicitly ported to work with IronPython.
You might have to dig into the individual modules and check to see which ones work or are pure python and find out which if any of the C-based ones have been ported yet.

Categories

Resources