Pure python matplotlib for Google App Engine

Hi all,

Google App Engine recently added an experimental Python 2.7 option, and
along with it, support for numpy.

App Engine only allows pure python code to be uploaded. But now that numpy
is available on the server, I was hoping I could create a pure python build
of matplotlib that I can run on App Engine.

Any suggestions on how to do this (existing tutorial, or at least which
backend to use, etc.)? Is it possible?

Many thanks,
Jamie

···

--
View this message in context: http://old.nabble.com/Pure-python-matplotlib-for-Google-App-Engine-tp32721389p32721389.html
Sent from the matplotlib - users mailing list archive at Nabble.com.

Thats neat. I hadn’t heard that numpy was made available.

The big obstacles are the compiled portions. That rules out the AGG backend and any others that uses it. This would also impact some important polish that makes mpl look good. There is - somewhere - an html5 backend, but I haven’t tried it.

The other obstacle are the other compiled parts that handle some of the critical parts. For example, there is src/cntr.c for contouring, _image.cpp for things like imshow(), nxutils.c, and _path.cpp, which provides the widely used path calculation support. There are others as well, and they all get wrapped by CXX.

Would the app engine support cython code? Maybe that could be the way to minimize the cost of portting while not losing too much performance?

Cheers!
Ben Root

···

On Tuesday, October 25, 2011, jniemasik <niemasik@…287…> wrote:

Hi all,

Google App Engine recently added an experimental Python 2.7 option, and

along with it, support for numpy.

App Engine only allows pure python code to be uploaded. But now that numpy
is available on the server, I was hoping I could create a pure python build
of matplotlib that I can run on App Engine.

Any suggestions on how to do this (existing tutorial, or at least which
backend to use, etc.)? Is it possible?

Many thanks,
Jamie

One thing I just noticed is that PIL is available.in the app engine I wonder if a PIL based backend might be suitable for replacing the compiled _png.so used for writing png images and maybe some other formats in the app engine?

Ben Root

···

On Tuesday, October 25, 2011, jniemasik <niemasik@…287…> wrote:

Hi all,

Google App Engine recently added an experimental Python 2.7 option, and

along with it, support for numpy.

App Engine only allows pure python code to be uploaded. But now that numpy
is available on the server, I was hoping I could create a pure python build
of matplotlib that I can run on App Engine.

Any suggestions on how to do this (existing tutorial, or at least which
backend to use, etc.)? Is it possible?

Many thanks,
Jamie

With the pure Python backends (PS, PDF, SVG) you should be able to
do most things, except actually rasterize an image… but since it’s
a webapp anyway, SVG should suffice and have it rendered in the
client. Of course there are still pieces that would need to be
rewritten in Python – contouring, path simplification, geometry
functions, font handling. I don’t know if the PIL FontImage support
would suffice as a replacement for the freetype wrapper we currently
have – otherwise reimplementing freetype in Python (even to just
get the font metrics) is probably considerable work.

In other words, it's possible, but not as it stands without

rewriting a lot of C++ code in Python.

Mike
···

On 10/26/2011 02:40 AM, Benjamin Root wrote:

  On Tuesday, October 25, 2011, jniemasik <niemasik@...287...      > > wrote:

  >

  > Hi all,

  >

  > Google App Engine recently added an experimental Python 2.7

option, and

  > along with it, support for numpy.

  >

  > App Engine only allows pure python code to be uploaded.  But

now that numpy

  > is available on the server, I was hoping I could create a

pure python build

  > of matplotlib that I can run on App Engine.

  >

  > Any suggestions on how to do this (existing tutorial, or at

least which

  > backend to use, etc.)?  Is it possible?

  >

  > Many thanks,

  > Jamie



  One thing I just noticed is that PIL is [available.in](http://available.in) the app engine  I

wonder if a PIL based backend might be suitable for replacing the
compiled _png.so used for writing png images and maybe some other
formats in the app engine?

Thanks Michael and Benjamin — this answers all my questions.

···

On Wednesday, October 26, 2011 at 11:11 AM, Michael Droettboom wrote:

On 10/26/2011 02:40 AM, Benjamin Root wrote:

  On Tuesday, October 25, 2011, jniemasik <niemasik@...287...      > > > wrote:

  >

  > Hi all,

  >

  > Google App Engine recently added an experimental Python 2.7

option, and

  > along with it, support for numpy.

  >

  > App Engine only allows pure python code to be uploaded.  But

now that numpy

  > is available on the server, I was hoping I could create a

pure python build

  > of matplotlib that I can run on App Engine.

  >

  > Any suggestions on how to do this (existing tutorial, or at

least which

  > backend to use, etc.)?  Is it possible?

  >

  > Many thanks,

  > Jamie



  One thing I just noticed is that PIL is [available.in](http://available.in) the app engine  I

wonder if a PIL based backend might be suitable for replacing the
compiled _png.so used for writing png images and maybe some other
formats in the app engine?

With the pure Python backends (PS, PDF, SVG) you should be able to

do most things, except actually rasterize an image… but since it’s
a webapp anyway, SVG should suffice and have it rendered in the
client. Of course there are still pieces that would need to be
rewritten in Python – contouring, path simplification, geometry
functions, font handling. I don’t know if the PIL FontImage support
would suffice as a replacement for the freetype wrapper we currently
have – otherwise reimplementing freetype in Python (even to just
get the font metrics) is probably considerable work.

In other words, it's possible, but not as it stands without

rewriting a lot of C++ code in Python.

Mike

The demand for IT networking professionals continues to grow, and the

demand for specialized networking skills is growing even more rapidly.

Take a complimentary Learning@…713…826… Self-Assessment and learn

about Cisco certifications, training, and career opportunities.

http://p.sf.net/sfu/cisco-dev2dev


Matplotlib-users mailing list

Matplotlib-users@lists.sourceforge.net

https://lists.sourceforge.net/lists/listinfo/matplotlib-users