{ "info": { "author": "Marinko Peso", "author_email": "marinko.peso@gmail.com", "bugtrack_url": null, "classifiers": [ "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.6" ], "description": "# shamus\n[![Open Source Love](https://badges.frapsoft.com/os/v1/open-source.svg?v=103)](https://github.com/ellerbrock/open-source-badges/)\n[![PyPI](https://img.shields.io/pypi/v/shamus.svg)](https://pypi.org/project/shamus/)\n[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/shamus.svg)](https://pypi.org/project/shamus/)\n[![license](https://img.shields.io/github/license/marinko-peso/shamus.svg)](https://github.com/marinko-peso/shamus/blob/master/LICENSE)\n[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](http://makeapullrequest.com)\n\nSmall python decorator for basic method time and memory usage.\n\n## Installation\n\nAvailable via PyPi, latest version 0.7. Latest Python 2 compatible version 0.5.\n```sh\npip install shamus\npipenv install shamus\n```\nDepends on ```psutil>=5.0.0```.\n\n## Usage\n\n```python\nimport random\nfrom shamus import shamus\n\nnames = ['Steve', 'Michael', 'Tom']\nlanguage = ['Python', 'Javascript', 'Java', 'PHP']\n\n@shamus()\ndef generate_coders():\n final_list = list()\n for i in xrange(800000):\n final_list.append({\n 'order': i,\n 'name': random.choice(names),\n 'codes': random.choice(language)\n })\n return final_list\n```\n\n## Output\n\nIf output_console is set to true, output looks like:\n```sh\n--\nshamus says @(04-12-2018 07:59:44 UTC) for [generate_coders]\n -> Memory: 242.7266 [MB]\n -> Time: 1.3413 [s]\n--\n```\nFor output_log set to true, file ```shamus_generate_coders.log``` is created in the specified location with the format:\n```log\nINFO:root:shamus timestamp: 04-12-2018 08:01:19 UTC\nCRITICAL:root:Memory: 242.7969 [MB]\nINFO:root:Time: 1.316 [s]\n\nINFO:root:shamus timestamp: 04-12-2018 08:01:22 UTC\nCRITICAL:root:Memory: 242.5469 [MB]\nINFO:root:Time: 1.316 [s]\n```\n\n## Options\n\nDefault options are as followed.\n```python\nDEFAULT_OPTIONS = {\n 'output_console': True,\n 'output_log': False,\n 'output_log_dir': '',\n 'memory_warning_levels': (1, 15),\n 'time_warning_levels': (2, 10)\n}\n```\nYou can overwrite arbitrary options and send them as dict when calling the shamus decorator.\nFor instance, to make sure logs are created and stored in ```/var/log/``` directory:\n```python\n@shamus({'output_log': True, 'output_log_dir: '/var/log'})\ndef your_method_here():\n pass\n```\nWhen log location is not specified, they are created in the current directory. Invalid log locations are ignored (non existing directories or directories with no write access).\n\nCustom memory and time warning levels can also be sent, in a format of tuple with two positive number, second greater then first. Parameters not complying with this format are also ignored.\nMemory and time warning specify three levels, for lets say levels (1, 20):\n- ```ok``` - everything below 1 is ok (green terminal color, info logging)\n- ```warning``` - everything below 1 and 20 is warning (yellow terminal color, warning logging)\n- ```critical``` - everything above 20 is critical (red terminal color, critical logging)\n\n\n\n## Python versions\n\nVersion 0.5 and less are compatible with Python 2.7.x (not supported anymore), from 0.6 compatible with Python 3.6.x.\nTime to upgrade that Python people!\n\n## License\n\nMIT", "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/marinko-peso/shamus", "keywords": "decorator memory time method", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "shamus", "package_url": "https://pypi.org/project/shamus/", "platform": "", "project_url": "https://pypi.org/project/shamus/", "project_urls": { "Homepage": "https://github.com/marinko-peso/shamus" }, "release_url": "https://pypi.org/project/shamus/0.7/", "requires_dist": null, "requires_python": "", "summary": "Small python decorator for basic method time and memory usage.", "version": "0.7" }, "last_serial": 3873008, "releases": { "0.3": [ { "comment_text": "", "digests": { "md5": "3125c8d92de1568f5788b8406cdcdd5a", "sha256": "17bef9a46e1dbb61d544e8988735d327a1aa8b6b9fece599cfa157a69c7ec74e" }, "downloads": -1, "filename": "shamus-0.3.tar.gz", "has_sig": false, "md5_digest": "3125c8d92de1568f5788b8406cdcdd5a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2587, "upload_time": "2018-04-11T15:51:24", "url": "https://files.pythonhosted.org/packages/a1/f1/9fdb853554c61df70b1c2c273db54174930e32c88c658f84d5663ec3f881/shamus-0.3.tar.gz" } ], "0.4": [ { "comment_text": "", "digests": { "md5": "a60d129e0372d845a7b88d50f63d4562", "sha256": "c0d27ba1482e2fd5ec91c3129079e10a02d02668c371f0f07dd9d551b276844d" }, "downloads": -1, "filename": "shamus-0.4.tar.gz", "has_sig": false, "md5_digest": "a60d129e0372d845a7b88d50f63d4562", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4837, "upload_time": "2018-04-12T08:56:40", "url": "https://files.pythonhosted.org/packages/34/93/4f2c42fe6450ea291b18175b6957db018ae8a30203ec561c6cae4d7e5de4/shamus-0.4.tar.gz" } ], "0.5": [ { "comment_text": "", "digests": { "md5": "8e608c4c9cecbe31fa7cf118ef224a52", "sha256": "4f11603b816edf49cb8f31201c26c7b04c924c1312b758d0b00eb11b4bb1fcc0" }, "downloads": -1, "filename": "shamus-0.5.tar.gz", "has_sig": false, "md5_digest": "8e608c4c9cecbe31fa7cf118ef224a52", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5194, "upload_time": "2018-04-24T09:59:16", "url": "https://files.pythonhosted.org/packages/f4/c7/b129f7cf8340a92ea3c2a4a1edea4d09257e27b69ed15c16d38349babf24/shamus-0.5.tar.gz" } ], "0.6": [ { "comment_text": "", "digests": { "md5": "df543ad22d688982caac388dbbb29876", "sha256": "a5d44f2b63f72a9bc0fecc7bfa1d4b7ac585c19b46a65b031aa64f9d5e4b073c" }, "downloads": -1, "filename": "shamus-0.6.tar.gz", "has_sig": false, "md5_digest": "df543ad22d688982caac388dbbb29876", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5274, "upload_time": "2018-05-07T07:41:32", "url": "https://files.pythonhosted.org/packages/d4/aa/9e7ab91cb832ff904df36f53ee33b4e93022ae0510e292bce26f43e5e926/shamus-0.6.tar.gz" } ], "0.7": [ { "comment_text": "", "digests": { "md5": "3b7f0f64a973185c94af53bf65afe6d5", "sha256": "04e2db314b2f524b5e31fadecb956452e698c00e76261e4abb30660510d3719b" }, "downloads": -1, "filename": "shamus-0.7.tar.gz", "has_sig": false, "md5_digest": "3b7f0f64a973185c94af53bf65afe6d5", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5401, "upload_time": "2018-05-17T16:21:27", "url": "https://files.pythonhosted.org/packages/0b/74/4cbb1534563d62e27528f0dca99d7760dac4d1c2dd4c8de94fcc725f544a/shamus-0.7.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "3b7f0f64a973185c94af53bf65afe6d5", "sha256": "04e2db314b2f524b5e31fadecb956452e698c00e76261e4abb30660510d3719b" }, "downloads": -1, "filename": "shamus-0.7.tar.gz", "has_sig": false, "md5_digest": "3b7f0f64a973185c94af53bf65afe6d5", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5401, "upload_time": "2018-05-17T16:21:27", "url": "https://files.pythonhosted.org/packages/0b/74/4cbb1534563d62e27528f0dca99d7760dac4d1c2dd4c8de94fcc725f544a/shamus-0.7.tar.gz" } ] }