{ "info": { "author": "Dinu Gherman", "author_email": "gherman@darwin.in-berlin.de", "bugtrack_url": null, "classifiers": [ "Environment :: Console", "Intended Audience :: Developers", "License :: OSI Approved :: GNU General Public License (GPL)", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6" ], "description": "Sparklines\n==========\n\n|ci| |pypi|\n\n.. |ci| image:: http://img.shields.io/travis/deeplook/sparklines.svg\n :target: https://travis-ci.org/deeplook/sparklines\n\n.. |pypi| image:: https://img.shields.io/pypi/v/sparklines.svg\n :target: https://pypi.python.org/pypi/sparklines\n\nThis Python package implements Edward Tufte's concept of sparklines_, but\nlimited to text only e.g. like this: \u2583\u2581\u2584\u2581\u2585\u2588\u2582\u2585 (this I likely not displayed\ncorrectly in every browser). You can find more information about sparklines\n`on Wikipedia`_. This code was mainly developed for running simple\nplausibility tests in sensor networks as shown in fig. 1 below:\n\n.. figure:: https://raw.githubusercontent.com/deeplook/sparklines/master/example_sensors.png\n :width: 75%\n :alt: example usecase with sensor values\n :align: center\n\n Fig. 1: Example usecase for such \"sparklines\" on the command-line,\n showing IoT sensor values (generating code not included here).\n\nDue to limitations of available Unicode characters this works best when all\nvalues are positive. And even then true sparklines that look more like lines\nand less like bars are a real challenge, because they would need multiple\ncharacters with a single horizontal line on different vertical positions. This\nwould work only with a dedicated font, which is way beyond the scope of this\ntool and which would significantly complicate its usage. So we stick to these\ncharacters: \"\u2581\u2582\u2583\u2584\u2585\u2586\u2587\u2588\", and use a blank for missing values.\n\nThis code was tested ok for Python 2.6 to 2.7 and 3.2 to 3.5.\n\n\nSample output\n-------------\n\nThis is a recorded sample session illustrating how to use ``sparklines`` (as\nGitHub doesn't render embedded Asciinema_ recordings you'll see here an image\npointing to the respective\n`asciicast `_):\n\n.. image:: https://asciinema.org/a/5xwfvcrrk09fy3ml3a8n67hep.png\n :target: https://asciinema.org/a/5xwfvcrrk09fy3ml3a8n67hep\n\nHere is some example output on the command-line (please note that in some\nbrowsers the vertical alignment of these block characters might be displayed\nslightly wrong, the same effect can be seen for other repos referenced below):\n\nExamples for the code below:\n\n.. code-block:: bash\n\n $ sparklines 2 7 1 8 2 8 1 8\n \u2582\u2587\u2581\u2588\u2582\u2588\u2581\u2588\n $ echo 2 7 1 8 2 8 1 8 | sparklines\n \u2582\u2587\u2581\u2588\u2582\u2588\u2581\u2588\n $ sparklines < numbers.txt\n \u2582\u2587\u2581\u2588\u2582\u2588\u2581\u2588\n $ sparklines 0 2. 1e0\n \u2581\u2588\u2585\n\n\nInstallation\n------------\n\nYou can install this package using ``pip install sparklines`` from the `Python\nPackage Index`_.\nYou can also clone this repository and install it via ``python setup.py install``\nor ``pip install -e .``.\nAfter installing, you will have access system-wide (or in your virtualenv\nif you have used that) to ``sparklines``, programmatically as well as via a\ncommand-line tool with the same name.\n\nTest\n----\n\nTo run the (still very small) \"test suite\", download and unpack this repository\nor clone it, and run the command ``python setup.py test`` in the unpacked\narchive. This will use a minified version of the ``pytest`` package included\nin this package in the file ``test/runtests.py``. If you have the excellent\n``pytest`` package installed you can also run ``py.test test`` from the \ndownloaded repository's root folder.\n\n\nUsage\n-----\n\nPlease note that the samples below might look a little funky (misaligned or \neven colored) in some browsers, but it should be totally fine when you print\nthis in your terminal, Python or IPython session or your Python IDE of choice.\nFigure 2 below might sshow better what you should expect than the copied sample\ncode thereafter:\n\n.. figure:: https://raw.githubusercontent.com/deeplook/sparklines/master/example_python.png\n :width: 65%\n :alt: example interactive invocation\n :align: center\n\n Fig. 2: Example invocation from a Python and an IPython session.\n\n\nCommand-Line\n............\n\nHere are two sample invocations from the command-line, copied into this README:\n\n.. code-block:: console\n\n $ sparklines 1 2 3 4 5.0 null 3 2 1\n \u2581\u2583\u2585\u2586\u2588 \u2585\u2583\u2581\n\n $ sparklines -n 2 1 2 3 4 5.0 null 3 2 1\n \u2581\u2585\u2588 \u2581 \n \u2581\u2585\u2588\u2588\u2588 \u2588\u2585\u2581\n\n\nProgrammatic\n............\n\nAnd here are sample invocations from interactive Python sessions, copied into\nthis README. The main function to use programmatically is \n``sparklines.sparklines()``:\n\n.. code-block:: python\n\n In [1]: from sparklines import sparklines\n\n In [2]: for line in sparklines([1, 2, 3, 4, 5.0, None, 3, 2, 1]):\n ...: print(line)\n ...: \n \u2581\u2583\u2585\u2586\u2588 \u2585\u2583\u2581\n\n In [3]: for line in sparklines([1, 2, 3, 4, 5.0, None, 3, 2, 1], num_lines=2):\n print(line)\n ...: \n \u2581\u2585\u2588 \u2581 \n \u2581\u2585\u2588\u2588\u2588 \u2588\u2585\u2581\n\n\nReferences\n----------\n\nThis code was inspired by Zach Holman's `spark \n`_, converted to a Python module \nby Kenneth Reitz as `spark.py \n`_ \nand by RegKrieg to a Python package named `pysparklines `_.\nAnd Roger Allen provides an even `shorter spark.py \n`_.\n\nBut since it is so short and easy to code in Python we can add a few nice\nextra features I was missing, like:\n\n- increasing resolution with multiple output lines per sparkline\n- showing gaps in input numbers for missing data\n- issuing warnings for negative values (allowed, but misleading)\n- highlighting values exceeding some threshold with a different\n color (if ``termcolor`` package is available)\n- wrapping long sparklines at some max. length\n- (todo) adding separator characters like ``:`` at regular intervals\n\n.. _Asciinema: https://asciinema.org\n.. _Python Package Index: https://pypi.python.org/pypi/sparklines/\n.. _sparklines: http://www.edwardtufte.com/bboard/q-and-a-fetch-msg?msg_id=0001OR\n.. _on Wikipedia: https://en.wikipedia.org/wiki/Sparkline\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/deeplook/sparklines", "keywords": "visualization", "license": "GPL", "maintainer": "", "maintainer_email": "", "name": "sparklines", "package_url": "https://pypi.org/project/sparklines/", "platform": "", "project_url": "https://pypi.org/project/sparklines/", "project_urls": { "Homepage": "https://github.com/deeplook/sparklines" }, "release_url": "https://pypi.org/project/sparklines/0.4.2/", "requires_dist": null, "requires_python": "", "summary": "Generate sparklines for numbers using Unicode characters only.", "version": "0.4.2" }, "last_serial": 4108011, "releases": { "0.2.0": [ { "comment_text": "", "digests": { "md5": "750c89b3868b885ec8bdef10796dc07c", "sha256": "526789c8763087164da02aa078f2173ab50208ab9aa72d6e37dd2be52fdab7e1" }, "downloads": -1, "filename": "sparklines-0.2.0.tar.gz", "has_sig": false, "md5_digest": "750c89b3868b885ec8bdef10796dc07c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 18808, "upload_time": "2016-05-18T07:38:52", "url": "https://files.pythonhosted.org/packages/80/e8/444e6fbff3f8e6ed6c452067aa65f58da73c396b01d59b295bc2342f6383/sparklines-0.2.0.tar.gz" } ], "0.3.0": [ { "comment_text": "", "digests": { "md5": "5de15a349a24b2c44febddcad26c8694", "sha256": "3145272d9bb267be2c92003254fbd763d09b812e21536083f803d056dacbf24f" }, "downloads": -1, "filename": "sparklines-0.3.0.tar.gz", "has_sig": false, "md5_digest": "5de15a349a24b2c44febddcad26c8694", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 19501, "upload_time": "2016-05-19T21:10:59", "url": "https://files.pythonhosted.org/packages/b2/14/a5234646f6b7cd707e62b499ad7bf2c426fa6070915b128aa6aed8bdf2a7/sparklines-0.3.0.tar.gz" } ], "0.4.0": [ { "comment_text": "", "digests": { "md5": "178f7c458bc503005e3ad76814e3b349", "sha256": "8995d8b3f80dbee843f4085ea65cbcacb0b0e0dc9f94b9b2debb5f8c4c6bf368" }, "downloads": -1, "filename": "sparklines-0.4.0.tar.gz", "has_sig": false, "md5_digest": "178f7c458bc503005e3ad76814e3b349", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 20637, "upload_time": "2016-06-09T09:40:36", "url": "https://files.pythonhosted.org/packages/0d/39/1e30171ad0ee39ae50fe56c28bbb27bb5565ec0445a241af62595f73f840/sparklines-0.4.0.tar.gz" } ], "0.4.1": [ { "comment_text": "", "digests": { "md5": "79661656312ad3170c15e9a9b0fb912a", "sha256": "8f996505b25ecd01ef9535c38ccd3157059181a9b42a17cbd1a7355e7d1d6763" }, "downloads": -1, "filename": "sparklines-0.4.1.tar.gz", "has_sig": false, "md5_digest": "79661656312ad3170c15e9a9b0fb912a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 20774, "upload_time": "2016-07-19T13:22:51", "url": "https://files.pythonhosted.org/packages/52/02/c70c314bff579fae14ddb44b7e6b9ac171de79aec2d13ca88b54883ca4b1/sparklines-0.4.1.tar.gz" } ], "0.4.2": [ { "comment_text": "", "digests": { "md5": "91797d85be97b6ab2f29fa665c255212", "sha256": "7c33fd6dc8b277b1fd729b31428df58a785c68be58202f439128e815f1dcae88" }, "downloads": -1, "filename": "sparklines-0.4.2.tar.gz", "has_sig": false, "md5_digest": "91797d85be97b6ab2f29fa665c255212", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 225407, "upload_time": "2018-07-27T09:46:01", "url": "https://files.pythonhosted.org/packages/04/0d/a4b03bacacb2e057680568757ec75b522077b93fa66fc14c1f2633d24b57/sparklines-0.4.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "91797d85be97b6ab2f29fa665c255212", "sha256": "7c33fd6dc8b277b1fd729b31428df58a785c68be58202f439128e815f1dcae88" }, "downloads": -1, "filename": "sparklines-0.4.2.tar.gz", "has_sig": false, "md5_digest": "91797d85be97b6ab2f29fa665c255212", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 225407, "upload_time": "2018-07-27T09:46:01", "url": "https://files.pythonhosted.org/packages/04/0d/a4b03bacacb2e057680568757ec75b522077b93fa66fc14c1f2633d24b57/sparklines-0.4.2.tar.gz" } ] }