{ "info": { "author": "Kai", "author_email": "k@limist.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Environment :: Web Environment", "Framework :: Django", "Intended Audience :: Developers", "License :: OSI Approved :: GNU General Public License (GPL)", "Operating System :: OS Independent", "Programming Language :: Python", "Topic :: Internet :: WWW/HTTP", "Topic :: Multimedia :: Graphics" ], "description": "Overview\n============================================================\n\nAs a developer, the need to display data charts and graphs on your web\nsite/service presents two major generation options: server-side, or\nclient/browser-side.\n\n- The primary benefits of server-side chart generation are: completely\n consistent display across browsers (even IE can handle showing\n images), and re-use of the chart image outside the browser, e.g. in\n generating PDF documents.\n\n- The primary benefit of client/browser-side chart generation is:\n interactivity (if needed), or generally more dynamic behavior,\n e.g. immediately updated charts with a user's new input.\n\nwebplotlib could be for you if you want Python server-side chart\ngeneration, providing a convenient and modular package/API. It is GPL\nlicensed.\n\n\nInstallation\n------------\n\nNOTE: Even though I wrote this package for a Django context, it can\neasily be used without/outside Django. See below for more details.\n\nwebplotlib has these direct dependencies:\n\n1. Numpy, which Matplotlib also depends on. You can install this\n globally (e.g. sudo pip install numpy) or just for the relevant\n virtualenv. For its full functionality you'll want to install\n system dependencies (like Fortran), e.g. on Ubuntu, the packages\n libatlas-base-dev, gfortran, gcc, g++.\n2. Matplotlib - you can get this via your OS packaging system (likely\n too old), from PyPI, or from source. The latest version, 1.0.1, is\n ostensibly on PyPI, but pip pulls down the wrong version currently\n (as of May 2011; not pip's fault, see this `SO discussion`_),\n unless you do the following:\n pip install -f http://downloads.sourceforge.net/project/matplotlib/matplotlib/matplotlib-1.0.1/matplotlib-1.0.1.tar.gz matplotlib\n You can also install this globally or locally to one virtualenv.\n Note that Matplotlib has numerous system dependencies depending on\n usage: e.g. for server usage on Ubuntu, install packages: python,\n python-dev, libpng12-dev, libfreetype6-dev.\n3. py.test, if you want to run the unit tests.\n\n\n.. _SO discussion: http://stackoverflow.com/questions/3555551/why-does-pip-install-matplotlib-version-0-91-1-when-pypi-shows-version-1-0-0\n\n\nWith dependencies installed (and within the relevant virtualenv),\ninstall webplotlib from PyPI with:\n\n::\n\n pip install webplotlib\n\n\nOr you can install from source via github.\n\n\nUsage\n-----\n\nWhile I wrote webplotlib to work with a Django project, currently\nthere are no direct dependencies on Django, so you can treat\nwebplotlib like any other Python package and call it directly. For\nexample:\n\n::\n\n from webplotlib.chart_builders import create_chart_as_png_str\n \n \n # When you have at least one sequence (list, tuple, iterable) \n # of data, you can plot it:\n chart_png_str = create_chart_as_png_str(\n 'timeseries',\n {'data': [[your_data_sequence]], 'names': 'MyDataLine'},\n labels_dct={'title': 'TheBigBoard', 'x': 'Data', 'y': 'Value'})\n # Save chart_png_str, etc.\n \n\nMore examples of usage can be found in the test_chart_builders.py\nmodule.\n\nDjango integration: I found confusing and inconsistent examples of\nintegrating Matplotlib with Django on the web, so experimented a bit\non my own. You can see some examples in webplotlib's views.py file\nwhich shows how to serve/return server-side generated PNG charts\ndirectly as a string - which can be handy for rapid feedback when you\nwant to style a chart.\n\nSo to use webplotlib in Django, update your Django project's\nsettings.py INSTALLED_APPS to include 'webplotlib' and also update\nyour project's urls.py file (there's nothing in models.py yet) to have\nsomething like,\n\n::\n\n urlpatterns = patterns('',\n ...\n (r'^wpl/', include('webplotlib.urls')),\n ...\n )\n\n\nAlso, consider using webplotlib with my app django-metaimage_, which\nreadily handles creating new images and saving them to a useful Django\nORM model instance/representation.\n\n\n.. _django-metaimage: https://github.com/limist/django-metaimage\n\n\nTesting\n-------\n\nBasic unit tests can be run using Tox_ or py.test. \n\n\n.. _Tox: http://codespeak.net/tox/\n\n\nHistory + Design\n----------------\n\nwebplotlib relies on Matplotlib_ - the most powerful and popular\nPython charting package available - for the actual chart generation.\nBut what I found (as of Spring 2011) was a lack of well-abstracted\nexamples of Matplotlib usage in web environments, as well as a lack of\nexamples using its non-interactive, object-oriented, programmer's\ninterface (by contrast, there are tons of examples_ for interactive\nuser-driven chart creation, emulating MATLAB). Thus the need to write\na new app that could quickly be used to generate server-side charts.\n\nI wanted a way to generate a Matplotlib chart (time-series and bar\ncharts initially) with a single function call that would create and\nreturn the raw chart data/image as a string - from there it's easy to\nsave it, or process it further (e.g. add watermark), or return it via\nHTTP, etc. After studying lots of online examples and documentation,\nexperimenting, and refactoring, enter webplotlib. Initially it\nsupports time-series and bar charts, taking sequences and returning\nnon-ugly charts as PNG-image strings you can readily use. There will\nbe more abstractions (e.g. defining chart templates separately) and\nimprovements to come, but this version is usable now.\n\nAlternatives: Why not use a Flash library? Not OSS, same limitations\nas Javascript library. And why not use a Javascript library? After\nlooking at a bunch of client-side libraries (Grafico, Highcharts,\nflot, Google Chart Tools, dygraphs, Rapha\u00ebl), I thought Protovis_ was\nit - the one tool to rule them all. But after making sense of their\ndocs and examples, I found displays were inconsistent: simple charts\nwould look fine in Firefox 3/4 but show up in Chrome without tick\nmarks and labels, which was unacceptable. And I didn't even bother\nlooking at IE rendering, where more pain was likely. Furthermore, my\nrequirements changed; I needed to use the charts in reporting, so it\nwas essential to have the charts as images, consistent across several\nmediums. So server-side generation was the way to go, and with\nPython, one finds out very quickly there's no serious competition to\nMatplotlib.\n\n\n.. _examples: http://matplotlib.sourceforge.net/gallery.html\n.. _Matplotlib: http://matplotlib.sourceforge.net/index.html\n.. _Protovis: http://vis.stanford.edu/protovis/", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://github.com/limist/webplotlib", "keywords": "django chart graph matplotlib server-side", "license": "GPL", "maintainer": null, "maintainer_email": null, "name": "webplotlib", "package_url": "https://pypi.org/project/webplotlib/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/webplotlib/", "project_urls": { "Download": "UNKNOWN", "Homepage": "http://github.com/limist/webplotlib" }, "release_url": "https://pypi.org/project/webplotlib/0.1/", "requires_dist": null, "requires_python": null, "summary": "A package for creating server-side charts/graphs using matplotlib; examples are also given for serving those charts directly via Django.", "version": "0.1" }, "last_serial": 743086, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "30257ccf78618ca8eb36fa19043c9156", "sha256": "0a16d980c42d89a63304bdadacf67cba4c54bf164a5ff65310a6c2d9aee5882c" }, "downloads": -1, "filename": "webplotlib-0.1-py2.6.egg", "has_sig": false, "md5_digest": "30257ccf78618ca8eb36fa19043c9156", "packagetype": "bdist_egg", "python_version": "2.6", "requires_python": null, "size": 15586, "upload_time": "2011-05-26T04:38:47", "url": "https://files.pythonhosted.org/packages/fd/33/4fbe8319a17a436b2bbc0913f912300677cee88ac3f0ee3c8da2d517cbb4/webplotlib-0.1-py2.6.egg" }, { "comment_text": "", "digests": { "md5": "5bf63416e77892150c1fe269a2e06e5a", "sha256": "5c7c7c4c94d3f492ceaf21ca33443c4f1321a8867579bcd3274735ae2aa9aa1c" }, "downloads": -1, "filename": "webplotlib-0.1.tar.gz", "has_sig": false, "md5_digest": "5bf63416e77892150c1fe269a2e06e5a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8973, "upload_time": "2011-05-26T04:38:46", "url": "https://files.pythonhosted.org/packages/62/6a/fc6e8c87b0671ef0824b9256dff911b412b528b912d01e94d187fab39730/webplotlib-0.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "30257ccf78618ca8eb36fa19043c9156", "sha256": "0a16d980c42d89a63304bdadacf67cba4c54bf164a5ff65310a6c2d9aee5882c" }, "downloads": -1, "filename": "webplotlib-0.1-py2.6.egg", "has_sig": false, "md5_digest": "30257ccf78618ca8eb36fa19043c9156", "packagetype": "bdist_egg", "python_version": "2.6", "requires_python": null, "size": 15586, "upload_time": "2011-05-26T04:38:47", "url": "https://files.pythonhosted.org/packages/fd/33/4fbe8319a17a436b2bbc0913f912300677cee88ac3f0ee3c8da2d517cbb4/webplotlib-0.1-py2.6.egg" }, { "comment_text": "", "digests": { "md5": "5bf63416e77892150c1fe269a2e06e5a", "sha256": "5c7c7c4c94d3f492ceaf21ca33443c4f1321a8867579bcd3274735ae2aa9aa1c" }, "downloads": -1, "filename": "webplotlib-0.1.tar.gz", "has_sig": false, "md5_digest": "5bf63416e77892150c1fe269a2e06e5a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8973, "upload_time": "2011-05-26T04:38:46", "url": "https://files.pythonhosted.org/packages/62/6a/fc6e8c87b0671ef0824b9256dff911b412b528b912d01e94d187fab39730/webplotlib-0.1.tar.gz" } ] }