News for hackers. Stuff that matters.

Ask HN: Best Python graphing and reporting libraries for web app

I'm building a web site that will include multiple graphs and printable reports. The graphs are pretty simple line graphs (perhaps with multiple data sources). Ideally, the graphic library would be able to do some smoothing of the data.

The reports are also fairly simple (lists of data with said graphs).

What do you think the best graphing and reporting libraries (for the planned usage) out there are?

( 10 comments | 46 points | on HN )
Re:Ask HN: Best Python graphing and reporting libraries for ... by almost on Sunday April 26, 2009 @12:40PM (#580111)
For creating graphs you might want to look into SciPy's Matplotlib. It's a graphing library based on Matlab's stuff. Pretty good if you want those sort of graphs.

See: http://matplotlib.sourceforge.net/users/screenshots.html

Here are instructions on hooking it into Django: http://www.scipy.org/Cookbook/Matplotlib/Django

Re:Ask HN: Best Python graphing and reporting libraries for ... by gourneau on Sunday April 26, 2009 @01:30PM (#580187)
I am a fan of the Open Flash Chart 2 project: http://teethgrinder.co.uk/open-flash-chart-2/

As the name implies, they are flash charts, what except JSON data. There is a wonderful Python lib that makes it very easy to use OFC in a Pythonic way: http://btbytes.github.com/pyofc2/

Re:Ask HN: Best Python graphing and reporting libraries for ... by nailer on Sunday April 26, 2009 @04:17PM (#580383)
Agreed. PyOFC2's graphs have better interactivity than the other options - being able to see values at a specific point where the mouse cursor is is quite liked by my users. There are two distribution sites: one has far more sample code.
Re:Ask HN: Best Python graphing and reporting libraries for ... by thesethings on Sunday April 26, 2009 @02:24PM (#580233)
I second this recommendation. If you want to see it in action (though with PHP), check out piwik.org (the open source (Google-esque) analytics program.
Re:Ask HN: Best Python graphing and reporting libraries for ... by xeno42 on Sunday April 26, 2009 @12:46PM (#580121)
Flot is great for generating graphs directly in the browser, saving the roundtrip for the image and allowing some interactivity: http://code.google.com/p/flot/

You can also generate simple Sparklines client-side too: http://omnipotent.net/jquery.sparkline/

Re:Ask HN: Best Python graphing and reporting libraries for ... by mace on Sunday April 26, 2009 @02:40PM (#580244)
Pycha (PYthon CHArts) is pretty good. It use the Cairo vector graphics library.

http://www.lorenzogil.com/projects/pycha/

Re:Ask HN: Best Python graphing and reporting libraries for ... by loginx on Sunday April 26, 2009 @03:09PM (#580298)
I second this. Graphing libs fall into 2 camps:

- Flash and JS charts. Those are interactive and most of the processing takes place on the client side, but they cannot be embedded into email reports or PDF documents or anything else, and are very difficult for the average end-user to archive.

- Server-side generated images. Those are not interactive, but obviously can be embeded into anything and easily archived, so tend to be more flexible and require no extra dependencies, such as a fast JS engine or a plugin.

I've been working with both types for way too long, and I eventually settled on PyCha. I wrote a presets package for my apps that allow me to very quickly change every aspect of charts in bulk, and I was floored when I ran my charting benchmarks. It's also one of the few libraries that scale to a very high number of datapoints (provided you remove the line shadow).

Re:Ask HN: Best Python graphing and reporting libraries for ... by cloug on Sunday April 26, 2009 @12:40PM (#580110)
Google Chart is a good choice : various graph types & facility of use. You may want to use a wrapper like pygooglechart
Re:Ask HN: Best Python graphing and reporting libraries for ... by simonw on Sunday April 26, 2009 @03:49PM (#580351)
The Cairo-powered http://www.aeracode.org/projects/graphication/ is well worth a look - unfortunately the only documentation is examples at the moment.
Re:Ask HN: Best Python graphing and reporting libraries for ... by paraschopra on Monday April 27, 2009 @11:12AM (#581436)
Although not specific for Python (it is xml based), I find FusionCharts (http://www.fusioncharts.com/) the best of the breed