{ "info": { "author": "Niranjan Rajendran", "author_email": "me@niranjan.io", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: MIT License", "Programming Language :: Python", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Programming Language :: Python :: Implementation :: CPython", "Programming Language :: Python :: Implementation :: PyPy" ], "description": "\n\n
\n\n`email-miner` makes it easy to mine IMAP mailboxes in a simple pythonic way. It's a thin-wrapper around the awesome [IMAPClient](https://github.com/mjs/imapclient) library.\n\n### Installation\n\n`email-miner` is listed on [PyPI](https://pypi.org/project/email-miner/) and can be installed with pip:\n\n```bash\npip install email-miner\n```\n\n### Example\n\n```python\nfrom email_miner.miner import Miner\n\n# miner acts as a context manager to ensure connections are closed\nwith Miner('imap.gmail.com', 'john@gmail.com', 'xyzzy') as client:\n\n # folder switching as a context manager to ensure folder is closed\n with client.inbox(read_only=True):\n \n # get emails from the selected folder as a list\n emails = client.get_emails(unread_only=True, with_body=True)\n \n for email in emails:\n print('Subject:', email.subject)\n print('From:', email.from_addresses)\n print('To:', email.to_addresses)\n \n # the body is already parsed \n # and the attachments can be accessed directly\n for attachment in email.attachments:\n \n print('Attachment type:', attachment.content_type)\n print('Attachment name:', attachment.file_name)\n \n with open(attachment.file_name, 'wb') as file:\n file.write(attachment.file_content)\n```\n\n### License\n\nThis project is licensed under the [MIT License](https://choosealicense.com/licenses/mit/).\n\n```\nMIT License\n\nCopyright (c) 2019 Niranjan Rajendran\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\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/niranjan94/py-email-miner", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "email-miner", "package_url": "https://pypi.org/project/email-miner/", "platform": "", "project_url": "https://pypi.org/project/email-miner/", "project_urls": { "Homepage": "https://github.com/niranjan94/py-email-miner" }, "release_url": "https://pypi.org/project/email-miner/0.0.5/", "requires_dist": null, "requires_python": ">=3.6.0", "summary": "Email miner makes it easy to mine IMAP mailboxes in a simple pythonic way.", "version": "0.0.5" }, "last_serial": 5429662, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "cfb688af13ae0ed4174ce953e1575b38", "sha256": "be63d331cf8d706ddeb7125f516af2580475369f4b17438f038bfd30503dfb18" }, "downloads": -1, "filename": "email-miner-0.0.1.tar.gz", "has_sig": false, "md5_digest": "cfb688af13ae0ed4174ce953e1575b38", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6.0", "size": 5666, "upload_time": "2019-05-22T12:12:19", "url": "https://files.pythonhosted.org/packages/63/48/bf2e27f50726066bdd053145ae695be35a051639507829befb38bce631f2/email-miner-0.0.1.tar.gz" } ], "0.0.2": [ { "comment_text": "", "digests": { "md5": "3a6d9db84bfbb02c73bb37d4295d4f42", "sha256": "bc9a95eaf77579ecde4106bbb3817f871711f25ba418cdf80a57880cb63873b6" }, "downloads": -1, "filename": "email-miner-0.0.2.tar.gz", "has_sig": false, "md5_digest": "3a6d9db84bfbb02c73bb37d4295d4f42", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6.0", "size": 6010, "upload_time": "2019-05-22T12:34:26", "url": "https://files.pythonhosted.org/packages/92/d2/cc27d1c890a8b52f89672f8bec232794ebb8a70254ce44162a540846a477/email-miner-0.0.2.tar.gz" } ], "0.0.3": [ { "comment_text": "", "digests": { "md5": "f7e32cc16c58cf582c8b5526f57ea74f", "sha256": "0d828a99c16a0124c4bbfb3ff432b74c9a88367030eda00a621cf02469fecdbe" }, "downloads": -1, "filename": "email-miner-0.0.3.tar.gz", "has_sig": false, "md5_digest": "f7e32cc16c58cf582c8b5526f57ea74f", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6.0", "size": 6165, "upload_time": "2019-05-24T06:28:26", "url": "https://files.pythonhosted.org/packages/33/df/5418671075bb3af003826b37a497cb270792deadd3b4bde9ae584320a2a1/email-miner-0.0.3.tar.gz" } ], "0.0.4": [ { "comment_text": "", "digests": { "md5": "5c35342f6a70e17550b5f29e03e84e31", "sha256": "6f8384d084e1b4427acfc217e50a9cfd0986980152cbb35dae5300815b996279" }, "downloads": -1, "filename": "email-miner-0.0.4.tar.gz", "has_sig": false, "md5_digest": "5c35342f6a70e17550b5f29e03e84e31", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6.0", "size": 6200, "upload_time": "2019-06-21T08:27:02", "url": "https://files.pythonhosted.org/packages/01/67/f57b5f8fc0e606bb6c357a55f37c61bd690fa1ad3150da75d8c6386ba548/email-miner-0.0.4.tar.gz" } ], "0.0.5": [ { "comment_text": "", "digests": { "md5": "f000e038cd60914f2ed67a2997250528", "sha256": "d1a5fc63c8fc42c9a1abb1a838792f8498f91e8489ff38fb895219258095b9eb" }, "downloads": -1, "filename": "email-miner-0.0.5.tar.gz", "has_sig": false, "md5_digest": "f000e038cd60914f2ed67a2997250528", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6.0", "size": 6212, "upload_time": "2019-06-21T08:30:00", "url": "https://files.pythonhosted.org/packages/67/f5/9d4e42c31920bc92ab6118f2b2c68eff149a93987c89b6ea4db735c20427/email-miner-0.0.5.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "f000e038cd60914f2ed67a2997250528", "sha256": "d1a5fc63c8fc42c9a1abb1a838792f8498f91e8489ff38fb895219258095b9eb" }, "downloads": -1, "filename": "email-miner-0.0.5.tar.gz", "has_sig": false, "md5_digest": "f000e038cd60914f2ed67a2997250528", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6.0", "size": 6212, "upload_time": "2019-06-21T08:30:00", "url": "https://files.pythonhosted.org/packages/67/f5/9d4e42c31920bc92ab6118f2b2c68eff149a93987c89b6ea4db735c20427/email-miner-0.0.5.tar.gz" } ] }