{ "info": { "author": "shaoeric", "author_email": "shaoeric@foxmail.com", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python :: 3" ], "description": "## Introduction\n##### README: [English](https://github.com/shaoeric/pynotice/blob/master/README.md)|[中文](https://github.com/shaoeric/pynotice/blob/master/README-cn.md)\npynotice is a python3 module that can play a sound or send an email to inform you when your function finishes or goes wrong. \n\n#### Features\n___\n- Use default or custom wav file\n- Send email with an attachment of pictures or txt files\n- python decorator\n- No need specifying smtp server address, of course you can do it\n\n#### Installation\n___\nonly for python3 \n```\npip install pynotice\n```\n\n#### Usage\n___\n##### -Sound-\n##### inform you by playing sound when your function finishes\n```python\nfrom pynotice.sound.notice import noticeOnFinish\n\n@noticeOnFinish()\ndef foo(name=\"foooo\"): # your function\n return name\n\nret = foo()\nprint(ret)\n```\n##### inform you by playing sound when your function goes wrong\n```python\nfrom pynotice.sound.notice import noticeOnException, noticeOnFinish\n\n@noticeOnFinish()\n@noticeOnException()\ndef foo(name=\"aaa\"):\n return name\n```\n\n##### -Email-\n\nFirstly, please confirm you have opened SMTP functions in your email. And the method depends on your email server (For @163.com and @gmail.com you need to set your app private password) [gmail SMTP authorization](https://www.digitalocean.com/community/tutorials/how-to-use-google-s-smtp-server) | [qq email SMTP authorization](https://jingyan.baidu.com/article/6079ad0eb14aaa28fe86db5a.html)\n\n##### inform you of your function result by sending an email when your function finishes\n```python\nfrom pynotice.mail.notice import noticeOnFinish\nimport numpy as np\n\nsender = \"xxx@gmail.com\"\ncode = \"xxxxxxxxxxxxxxxx\" # SMTP authorization code \nreceiver = \"xxx@foxmail.com\" # list or str\n\n# you can also send an attachments\n@noticeOnFinish(sender, code, receiver, attachments=['demo.txt']) \ndef foo(name=\"aaa\"):\n x = np.array([[1, 2, 3], [2, 3, 4]])\n for i in range(100):\n if i%20==0:\n print(i)\n np.savetxt(\"demo.txt\", x)\n return x, [1,23,5,4], name\n\nret = foo()\nprint(ret)\n```\n\n#### inform you of the Exception by an email when the function throws exceptions\n```python\nfrom pynotice.mail.notice import noticeOnException, noticeOnFinish\n\nsender = \"xxx@qq.com\"\ncode = \"xxxxxxxxxxxxxxxx\" # SMTP authorization code \nreceiver = \"xxx@foxmail.com\" # list or str\n\n@noticeOnFinish(sender, code, receiver,attachments=[])\n@noticeOnException(sender, code, receiver)\ndef foo(name=\"aaa\"):\n return \"ccc\"\n\nre = foo()\n```\n\n#### Include\n| module | description |\n| ----- | ----------- |\n| [filetype](https://pypi.org/project/filetype/) | get the file format |\n| [simpleaudio](https://pypi.org/project/simpleaudio/1.0.2/) | play the wav audio | \n| [zmail](https://pypi.org/project/zmail/) | send emails simply |\n\n\n#### Resource\nTwo wav sounds in module are downloaded from [here](http://www.aigei.com/sound/class/). I have thought I can diy with my ipad, but I'm a green hand in that so ...\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/shaoeric/pynotice", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "pynotice", "package_url": "https://pypi.org/project/pynotice/", "platform": "", "project_url": "https://pypi.org/project/pynotice/", "project_urls": { "Homepage": "https://github.com/shaoeric/pynotice" }, "release_url": "https://pypi.org/project/pynotice/0.0.1/", "requires_dist": [ "simpleaudio (==1.0.2)", "zmail (==0.2.5)", "filetype (==1.0.5)" ], "requires_python": "", "summary": "notice by sound or email", "version": "0.0.1" }, "last_serial": 5654864, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "ce43f4b948ace317b02d24d5fe7e3c6f", "sha256": "26fadd6539d59b02521f1aacba642e86f4762b17b929180d3344fa6c71fd65d9" }, "downloads": -1, "filename": "pynotice-0.0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "ce43f4b948ace317b02d24d5fe7e3c6f", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 160477, "upload_time": "2019-08-09T10:35:43", "url": "https://files.pythonhosted.org/packages/37/03/1c66207142580ad11e7fa3f960bbf09d5018dd0a9b673b87614c1548c736/pynotice-0.0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "5369e88296b220f5b0a7c4b9a55d2099", "sha256": "6138de5eb09f844ff4d67eb63b0f330750b09b00b5492bb4d74f4bf565f26461" }, "downloads": -1, "filename": "pynotice-0.0.1.tar.gz", "has_sig": false, "md5_digest": "5369e88296b220f5b0a7c4b9a55d2099", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4621, "upload_time": "2019-08-09T10:35:45", "url": "https://files.pythonhosted.org/packages/bf/fb/ab64047563db80ba958394ebbb58472206f412d49e46c0efcbfae2212ce8/pynotice-0.0.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "ce43f4b948ace317b02d24d5fe7e3c6f", "sha256": "26fadd6539d59b02521f1aacba642e86f4762b17b929180d3344fa6c71fd65d9" }, "downloads": -1, "filename": "pynotice-0.0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "ce43f4b948ace317b02d24d5fe7e3c6f", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 160477, "upload_time": "2019-08-09T10:35:43", "url": "https://files.pythonhosted.org/packages/37/03/1c66207142580ad11e7fa3f960bbf09d5018dd0a9b673b87614c1548c736/pynotice-0.0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "5369e88296b220f5b0a7c4b9a55d2099", "sha256": "6138de5eb09f844ff4d67eb63b0f330750b09b00b5492bb4d74f4bf565f26461" }, "downloads": -1, "filename": "pynotice-0.0.1.tar.gz", "has_sig": false, "md5_digest": "5369e88296b220f5b0a7c4b9a55d2099", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4621, "upload_time": "2019-08-09T10:35:45", "url": "https://files.pythonhosted.org/packages/bf/fb/ab64047563db80ba958394ebbb58472206f412d49e46c0efcbfae2212ce8/pynotice-0.0.1.tar.gz" } ] }