{ "info": { "author": "soraxas", "author_email": "tin.lai@sydney.edu.au", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.7" ], "description": "# Async CSV Logger\n[![PyPI](https://img.shields.io/pypi/v/asynccsv.svg)](https://pypi.python.org/pypi/asynccsv)\n\nThis module is a async csv logger that helps you log performance of your algorithm.\n\n\n## Description\n\nThis module is intented to be a csv logger which will write to file async-ly.\n\nWith the hope to have minimum performance impact on benchmarking your algorithm (i.e. I/O blocking to write to disk), this is especially useful for logging performance at each iteration/time-step. Internally, it utilise threading to async write to file.\n\nThere are two way to initialise and use the logger.\n\n\n## Install\n\n```\npip install asynccsv\n```\n\n\n### 1. Recommended way (with block)\n\n```python\nimport time\nimport datetime\nfrom asynccsv import AsyncCSVLogger\n\nwith AsyncCSVLogger('path_of_your_log.csv') as logger:\n # csv titles\n logger.write(['Time', 'Accuracy', 'Num of nodes'])\n\n # do your other stuff\n # ......\n\n for i in range(10):\n # perform calculation\n # ....\n # write results to file\n logger.write([datetime.datetime.now().strftime(\"%S.%f\"), acc, num_nodes])\n time.sleep(0.5)\n```\n\n\n### 2. The normal way\n\n```python\nimport time\nfrom asynccsv import AsyncCSVLogger\n\nclass MyAwesomeAlgorithm():\n\n def __init__(self):\n # with the 'log_timestamp' flag it will automatically log timestamp\n self.logger = AsyncCSVLogger('path_of_your_log.csv', log_timestamp=True)\n self.logger.write(['Time', 'Accuracy', 'Num of nodes'])\n\n def run(self):\n # perform calculation\n # ...\n logger.write([acc, num_nodes])\n time.sleep(0.5)\n\n\nif __name__ == '__main__':\n awesome = MyAwesomeAlgorithm()\n for i in range(10):\n awesome.run()\n\n # You SHOULD run this to properly close the threading and force\n # everything to be written to disk\n # This is automatically done by the 'with' block in previous example\n awesome.logger.close()\n```\n\n---\n\nWith both methods, the final content of `path_of_your_log.csv` will look something like:\n\n```csv\n\"Time\",\"Accuracy\",\"Num of nodes\"\n\"57.689359\",\"92.5\",\"11\"\n\"58.189979\",\"93.5\",\"12\"\n\"58.690520\",\"94.22\",\"13\"\n\"59.191268\",\"93.5\",\"15\"\n\"59.692062\",\"92.2\",\"17\"\n\"00.192850\",\"92.4\",\"22\"\n\"00.693661\",\"94.8\",\"26\"\n\"01.194634\",\"96.6\",\"27\"\n\"01.695368\",\"94.1\",\"30\"\n\"02.196014\",\"97.5\",\"42\"\n\n```\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/soraxas/asynccsv", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "asynccsv", "package_url": "https://pypi.org/project/asynccsv/", "platform": "", "project_url": "https://pypi.org/project/asynccsv/", "project_urls": { "Homepage": "https://github.com/soraxas/asynccsv" }, "release_url": "https://pypi.org/project/asynccsv/1.0.2/", "requires_dist": null, "requires_python": "", "summary": "Async CSV performance logging", "version": "1.0.2" }, "last_serial": 5882633, "releases": { "1.0.0": [ { "comment_text": "", "digests": { "md5": "557a221580c6d08af73ae20eb797f5aa", "sha256": "657ebc0c9b9aaa1818c1e9184bd41a2e3d018e71ff9e62944a9a6d3466f283a4" }, "downloads": -1, "filename": "asynccsv-1.0.0-py3-none-any.whl", "has_sig": false, "md5_digest": "557a221580c6d08af73ae20eb797f5aa", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 1781, "upload_time": "2019-09-25T00:12:44", "url": "https://files.pythonhosted.org/packages/ac/96/8b1f7c1053d32af603f1c7339fd6aeff63f87fe9483b2c96aa0b40dffe71/asynccsv-1.0.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "6b15c2ef4510419ad188fd5e3f9b47bc", "sha256": "99f108a4c4ed21729b2bfedc8e40ab87e37a207f786cbdaad92f588fee987772" }, "downloads": -1, "filename": "asynccsv-1.0.0.tar.gz", "has_sig": false, "md5_digest": "6b15c2ef4510419ad188fd5e3f9b47bc", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2769, "upload_time": "2019-09-25T00:12:49", "url": "https://files.pythonhosted.org/packages/f6/d1/ddffb40a94d537403a9439ff15688975714edc87dd677b5c4f14472fa385/asynccsv-1.0.0.tar.gz" } ], "1.0.1": [ { "comment_text": "", "digests": { "md5": "60a9e59564686a11485afa683a8d6c8e", "sha256": "a15d97b63a483f5e8437cf2a3559e6e5bf63469416b2d5bae5b70289d4a5a73e" }, "downloads": -1, "filename": "asynccsv-1.0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "60a9e59564686a11485afa683a8d6c8e", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 1910, "upload_time": "2019-09-25T00:26:59", "url": "https://files.pythonhosted.org/packages/88/39/42bdc05a68c10d8da77ccf8c351c208782f46b714b0261364653c2624d33/asynccsv-1.0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "f51d5e5dbfc7a236550f3516405bd54f", "sha256": "c164cf0f7f8946d33d6aba092b67d96fd4a58716b207baceb84b1871b8352af8" }, "downloads": -1, "filename": "asynccsv-1.0.1.tar.gz", "has_sig": false, "md5_digest": "f51d5e5dbfc7a236550f3516405bd54f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2933, "upload_time": "2019-09-25T00:27:03", "url": "https://files.pythonhosted.org/packages/d6/d6/b247cf28c2cf825a675cd0d696eb30247b98f84563561fdf28d9ef2f0ca8/asynccsv-1.0.1.tar.gz" } ], "1.0.2": [ { "comment_text": "", "digests": { "md5": "43fd7b2d7ce41c5766656617ba041f86", "sha256": "fd6c7eb69c6e5b1582d00d7d0602952e5df9fd13a18dbfdd9159b9eac29bc03e" }, "downloads": -1, "filename": "asynccsv-1.0.2-py3-none-any.whl", "has_sig": false, "md5_digest": "43fd7b2d7ce41c5766656617ba041f86", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 2160, "upload_time": "2019-09-25T01:32:33", "url": "https://files.pythonhosted.org/packages/28/69/e9dd299df6b30d5b019a350eea35e774a341e40b157b35ecf84dcb7998aa/asynccsv-1.0.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "d0ee81cab208e53c75a5b8a6a8b7bf78", "sha256": "b0cb64424c2582a9366287a714f6984085c4316d474b8f36c0cd13c0d2aae235" }, "downloads": -1, "filename": "asynccsv-1.0.2.tar.gz", "has_sig": false, "md5_digest": "d0ee81cab208e53c75a5b8a6a8b7bf78", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2183, "upload_time": "2019-09-25T01:32:35", "url": "https://files.pythonhosted.org/packages/57/92/a99566d946e31d920706a0e5503e7a2add2708ff23cc35282b02371876c6/asynccsv-1.0.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "43fd7b2d7ce41c5766656617ba041f86", "sha256": "fd6c7eb69c6e5b1582d00d7d0602952e5df9fd13a18dbfdd9159b9eac29bc03e" }, "downloads": -1, "filename": "asynccsv-1.0.2-py3-none-any.whl", "has_sig": false, "md5_digest": "43fd7b2d7ce41c5766656617ba041f86", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 2160, "upload_time": "2019-09-25T01:32:33", "url": "https://files.pythonhosted.org/packages/28/69/e9dd299df6b30d5b019a350eea35e774a341e40b157b35ecf84dcb7998aa/asynccsv-1.0.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "d0ee81cab208e53c75a5b8a6a8b7bf78", "sha256": "b0cb64424c2582a9366287a714f6984085c4316d474b8f36c0cd13c0d2aae235" }, "downloads": -1, "filename": "asynccsv-1.0.2.tar.gz", "has_sig": false, "md5_digest": "d0ee81cab208e53c75a5b8a6a8b7bf78", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2183, "upload_time": "2019-09-25T01:32:35", "url": "https://files.pythonhosted.org/packages/57/92/a99566d946e31d920706a0e5503e7a2add2708ff23cc35282b02371876c6/asynccsv-1.0.2.tar.gz" } ] }