{ "info": { "author": "Noriyuki Abe", "author_email": "kenko.py@gmail.com", "bugtrack_url": null, "classifiers": [], "description": "==============================\nfusha.py\n==============================\n\nFusha is an easily customizable progress bar module for Python.\nIt contains default progress bars. However, you can write your own\nprogress bar easily to inherit the class provided in this package.\n\nFeatures\n----------\n\n* You can easily use fusha by using the **with** statement as follows;\n\n .. code-block:: python\n\n with Fusha():\n waiting_function()\n\n* You can easily write your own progress bar by inheriting\n the **FushaTemplate** class as follows;\n\n .. code-block:: python\n\n class Fusha(FushaTemplate):\n\n def __init__(self, interval=0.12)\n FushaTemplate.__init__(self, interval)\n\n def format(self):\n return waiting_format\n\n def exit_format(self):\n return exit_format\n\n\nInstallation\n-------------\n\n.. code-block:: sh\n\n $ python setup.py install\n\nor\n\n.. code-block:: sh\n\n $ pip install fusha\n\nGetting Started\n-----------------\n\nFusha provides default three progress bars - Fusha, FushaBar, and FushaBubble.\n\nThe most easiest way to use Fusha is just creating an instance of fusha with **with** statement\nbefore calling your function which you must wait for a while:\n\n.. code-block:: python\n\n import time\n from fusha import Fusha\n\n with Fusha():\n time.sleep(3)\n\nThat's all.\n\nDefault Progress Bars\n-----------------------\n\nFusha provides three default progress bars. You can use them as follows.\n\n.. code-block:: python\n\n import time\n from fusha import Fusha, FushaBar, FushaBubble\n\n print \"Fusha start\"\n with Fusha(interval=0.12, title='now loading ...'):\n time.sleep(3)\n print \"finish\"\n\n print \"FushaBar start\"\n with FushaBar(interval=0.12, bar_len=20) as f:\n for i in range(100):\n f.update(i)\n time.sleep(.1)\n print \"finish\"\n\n print \"FushaBubble start\"\n with FushaBubble(interval=0.2, title=\"now loading ...\"):\n time.sleep(3)\n print \"finish\"\n\nScreenshots\n-------------\n\nFusha\n\n.. image:: http://kenkov.jp/_images/software/Fusha.gif\n\nFushaBar\n\n.. image:: http://kenkov.jp/_images/software/FushaBar.gif\n\nFushaBubble\n\n.. image:: http://kenkov.jp/_images/software/FushaBubble.gif\n\nHow to Customize\n-------------------\n\nYou can easily create your own progress bar.\n\nFirst, you should create a new class which inherits the **FushaTemplate** class.\nThen, you should override two methods - **format** and **exit_format** .\nThe **format** method will be called while your function is running in the with statement;\non the other hand, the **exit_format** will be called after finishing your function.\nBoth functions should return string.\n\nThe following code is for FushaBubble:\n\n.. code-block:: sh\n\n from fusha import FushaTemplate\n\n class FushaBubble(FushaTemplate):\n\n def __init__(self,\n interval=0.12,\n title='waiting ...'):\n FushaTemplate.__init__(self, interval)\n self.title = title\n self._count = 0\n\n def format(self):\n if self._count % 3 == 0:\n fmt = '\\r{0} .'.format(self.title)\n elif self._count % 3 == 1:\n fmt = '\\r{0} o'.format(self.title)\n else:\n fmt = '\\r{0} O'.format(self.title)\n # set count\n if self._count == 2:\n self._count = 0\n else:\n self._count += 1\n return fmt\n\n def exit_format(self):\n return '\\r{0} done\\n'.format(self.title)\n\nLicense\n---------\n\nThe MIT License (MIT)", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/kenkov/fusha", "keywords": null, "license": "MIT License", "maintainer": null, "maintainer_email": null, "name": "fusha", "package_url": "https://pypi.org/project/fusha/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/fusha/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/kenkov/fusha" }, "release_url": "https://pypi.org/project/fusha/0.1/", "requires_dist": null, "requires_python": null, "summary": "Easily customizable progress bar module", "version": "0.1" }, "last_serial": 637295, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "9c0ab928378cbe954451497e71b317d5", "sha256": "0fe4263745b4df7de327f77fce0b17e1c32ae73dcb37fb7e3bbb01e780ddcbbe" }, "downloads": -1, "filename": "fusha-0.1.tar.gz", "has_sig": false, "md5_digest": "9c0ab928378cbe954451497e71b317d5", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3736, "upload_time": "2013-05-19T07:41:53", "url": "https://files.pythonhosted.org/packages/a5/9a/4d32d5b34a015895eecc283e0889ae04316c8f384db467c5f373887ffca1/fusha-0.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "9c0ab928378cbe954451497e71b317d5", "sha256": "0fe4263745b4df7de327f77fce0b17e1c32ae73dcb37fb7e3bbb01e780ddcbbe" }, "downloads": -1, "filename": "fusha-0.1.tar.gz", "has_sig": false, "md5_digest": "9c0ab928378cbe954451497e71b317d5", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3736, "upload_time": "2013-05-19T07:41:53", "url": "https://files.pythonhosted.org/packages/a5/9a/4d32d5b34a015895eecc283e0889ae04316c8f384db467c5f373887ffca1/fusha-0.1.tar.gz" } ] }