{ "info": { "author": "Tianshu Huang", "author_email": "thetianshuhuang@gmail.com", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python :: 3" ], "description": "# Syllabus\nTime and memory tracking task manager for Machine Learning applications\n\n![Print It!](https://github.com/thetianshuhuang/syllabus/blob/master/basic.png)\n\n## Dependencies\n- Python 3\n- print\n- ansiwrap\n\n## Requirements\n- min terminal width of 66 columns\n- ANSI color support\n\n# Usage\n\n## The Task Class\nThe ```Task``` class is the core of ```Syllabus```. Only one task should ever be created from scratch in any program; all other tasks should be spawned off of this task using ```subtask```.\n\n### Parameters\n- ```name```: str; name of the task\n- ```desc```: str; task description\n- ```mp```: bool; True if multiprocessing should be enabled. This creates a multiprocessing managed queue, which allows the queue to be shared with other processes; however, this operation requires creation of a dedicated process, and has a significant memory cost. Therefore, the ```mp``` flag should not be enabled unless multiprocessing is to be used.\n\n### Core Methods\n- ```start(name=None, desc=None)```: start the task (sets the start time). If name or description are not None, updates the task's name and description.\n- ```done(*objects, name=None, desc=None, nowait=False)```: mark the task as done (sets the end time).\n\t- ```name```, ```desc```: name and description; if not None, updates the name and description.\n\t- ```*objects```: list of objects. Adds the memory footprints of the objects, and stores it in order to track memory usage.\n\t- ```nowait```: is only considered if the task is a root task. If nowait is set to True, the program continues immediately; if nowait is set to False, the method blocks until the task's accountant finishes processing all messages.\n- ```subtask(name='Child Task', desc=None) -> Task```: create a subtask. This method should always be used when creating new tasks, since it passes the parent task's reporting queue on to the child.\n\t- ```name```: subtask name\n\t- ```desc```: subtask description\n\n### Status, Reporting\n- ```info(msg)```: send message; ```msg``` can be arbitrary type, as long as ```msg``` can be turned into a string with ```str()```)\n- ```print(msg)```: alias for ```info```\n- ```error(e)```: send error. ```e``` does not have to be an Exception.\n- ```warn(e)```: send warning. ```e``` does not have to be a Warning.\n- ```runtime() -> float```: get current runtime.\n- ```status() -> (int, int)```: get progress as (complete tasks, total tasks)\n- ```progress() -> float```: get progress as (complete tasks / total tasks)\n- ```add_task(n)```: add ```n``` tasks to the task counter\n- ```add_progress(n)```: mark an additional ```n``` tasks as completed\n\n### Multithreading\n- ```pool(target, args, shared_args=[], shared_kwargs={}, reducer=None, recursive=True, split=2, name='Child Task Thread', threads=None, process=False)```: Create a thread pool.\n\t- ```target```: target function\n\t- ```args```: list of args to pass in\n\t- ```shared_args```, ```shared_kwargs```: shared arguments to pass to all threads\n\t- ```reducer(retval[])```: if a function is passed, is used to combine results. Should take in a list of results (as returned by ```target```) and return a combined result.\n\t- ```recursive```: reduce recursively?\n\t- ```split```: if ```recursive```, how many entries per reduce?\n\t- ```name```: child task default name\n\t- ```threads```: number of threads; if ```None```, uses ```cpu_count()``` instead\n\n### Multiprocessing\n- ```pool(target, args, shared_args=None, shared_init=None, reducer=None, recursive=True, split=2, name='Child Task Process', cores=None)```: Create a process pool.\n\t- ```target```: target function\n\t- ```args```: list of args to pass in\n\t- ```shared_args```: shared arguments to pass to all threads\n\t- ```shared_init```: initializer for shared args\n\t- ```reducer(retval[])```: if a function is passed, is used to combine results. Should take in a list of results (as returned by ```target```) and return a combined result.\n\t- ```recursive```: reduce recursively?\n\t- ```split```: if ```recursive```, how many entries per reduce?\n\t- ```name```: child task default name\n\t- ```cores```: number of cores; if ```None```, uses ```cpu_count()``` instead\n\n## App\n\n### Parameters\n- ```BasicTaskApp(*args, refresh_rate=20, **kwargs)```: basic app with a updating output\n\t- ```refresh_rate```: output refresh rate, in Hz\n\t- Extends ```Task```; configuration options ```*args``` and ```**kwargs``` are passed on.\n\n- ```InteractiveTaskApp(*args, refresh_rate=20, **kwargs)```: more sophisticated terminal app with keyboard controls\n\t- ```refresh_rate```: output refresh rate, in Hz\n\t- Extends ```Task```; configuration options ```*args``` and ```**kwargs``` are passed on.\n\n- ```TaskViewer(file)```: viewer for saved task trees.\n\t- ```file```: input filename to open and parse\n\t- Methods:\n\t\t- ```print()```: print tree (same format as ```BasicTaskApp```)\n\t\t- ```save(file, color=False)```: save rendered output to file\n\t\t\t- ```file```: output filename\n\t\t\t- ```color```: if False, ANSI escape sequences are stripped before saving \n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/thetianshuhuang/syllabus", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "Syllabus", "package_url": "https://pypi.org/project/Syllabus/", "platform": "", "project_url": "https://pypi.org/project/Syllabus/", "project_urls": { "Homepage": "https://github.com/thetianshuhuang/syllabus" }, "release_url": "https://pypi.org/project/Syllabus/2.0/", "requires_dist": [ "printtools", "ansiwrap" ], "requires_python": "", "summary": "Time and memory tracking task manager for Machine Learning applications", "version": "2.0" }, "last_serial": 4994390, "releases": { "1.1": [ { "comment_text": "", "digests": { "md5": "b3d91028cf90e2d56e289e424f32bf8a", "sha256": "4ac6ed43c300f36b718b155799145defb914cc69bd298068dbc530fc0a517006" }, "downloads": -1, "filename": "Syllabus-1.1-py3-none-any.whl", "has_sig": false, "md5_digest": "b3d91028cf90e2d56e289e424f32bf8a", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 20800, "upload_time": "2019-03-27T19:05:42", "url": "https://files.pythonhosted.org/packages/8b/7b/03450dfcb78fde478b6214a5dacfa56514da762dba7874e5fd6a3bf4ad6e/Syllabus-1.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "88c99d1d60af79efad0ade2cb5c2c29b", "sha256": "8a72ed3eddcba6e84124abd496c0604678d17013ad7ab0828e9aab28aba76cac" }, "downloads": -1, "filename": "Syllabus-1.1.tar.gz", "has_sig": false, "md5_digest": "88c99d1d60af79efad0ade2cb5c2c29b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14289, "upload_time": "2019-03-27T19:05:44", "url": "https://files.pythonhosted.org/packages/ec/fc/00539a954ee02c64671addfeee1b2252214178242d293f8d26ea4aa7cafe/Syllabus-1.1.tar.gz" } ], "2.0": [ { "comment_text": "", "digests": { "md5": "0b64256382fcbf2d029afaf6c38aa378", "sha256": "b69363ffd6fd4b70742f1eebcb0074d1d9f004d2926730f62591e0c4f1457ebc" }, "downloads": -1, "filename": "Syllabus-2.0-py3-none-any.whl", "has_sig": false, "md5_digest": "0b64256382fcbf2d029afaf6c38aa378", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 23034, "upload_time": "2019-03-27T19:09:40", "url": "https://files.pythonhosted.org/packages/58/4e/14e1a04b7885970dadd6d43d67f466d775ec34cffc60b7e2aea640245316/Syllabus-2.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "41cc3f01b1994908c80500cf34611066", "sha256": "5003cb083af9cc0e3847f4bc4ffe530dae3d378753c896528fe6c6b09691e340" }, "downloads": -1, "filename": "Syllabus-2.0.tar.gz", "has_sig": false, "md5_digest": "41cc3f01b1994908c80500cf34611066", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 17967, "upload_time": "2019-03-27T19:09:42", "url": "https://files.pythonhosted.org/packages/c8/c8/0d28f2d8a9c4f1d6a9ac20b6cb29f247b88a36cfa117b709544f987e62fe/Syllabus-2.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "0b64256382fcbf2d029afaf6c38aa378", "sha256": "b69363ffd6fd4b70742f1eebcb0074d1d9f004d2926730f62591e0c4f1457ebc" }, "downloads": -1, "filename": "Syllabus-2.0-py3-none-any.whl", "has_sig": false, "md5_digest": "0b64256382fcbf2d029afaf6c38aa378", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 23034, "upload_time": "2019-03-27T19:09:40", "url": "https://files.pythonhosted.org/packages/58/4e/14e1a04b7885970dadd6d43d67f466d775ec34cffc60b7e2aea640245316/Syllabus-2.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "41cc3f01b1994908c80500cf34611066", "sha256": "5003cb083af9cc0e3847f4bc4ffe530dae3d378753c896528fe6c6b09691e340" }, "downloads": -1, "filename": "Syllabus-2.0.tar.gz", "has_sig": false, "md5_digest": "41cc3f01b1994908c80500cf34611066", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 17967, "upload_time": "2019-03-27T19:09:42", "url": "https://files.pythonhosted.org/packages/c8/c8/0d28f2d8a9c4f1d6a9ac20b6cb29f247b88a36cfa117b709544f987e62fe/Syllabus-2.0.tar.gz" } ] }