email miner使得以简单的python方式挖掘imap邮箱变得很容易。

email-miner的Python项目详细描述



email-miner使以简单的python方式挖掘imap邮箱变得容易。这是一个很薄的包装,围绕着很棒的IMAPClient库。

安装

email-miner列在PyPI上,可以与pip一起安装:

pip install email-miner

示例

fromemail_miner.minerimportMiner# miner acts as a context manager to ensure connections are closedwithMiner('imap.gmail.com','john@gmail.com','xyzzy')asclient:# folder switching as a context manager to ensure folder is closedwithclient.inbox(read_only=True):# get emails from the selected folder as a listemails=client.get_emails(unread_only=True,with_body=True)foremailinemails:print('Subject:',email.subject)print('From:',email.from_addresses)print('To:',email.to_addresses)# the body is already parsed # and the attachments can be accessed directlyforattachmentinemail.attachments:print('Attachment type:',attachment.content_type)print('Attachment name:',attachment.file_name)withopen(attachment.file_name,'wb')asfile:file.write(attachment.file_content)

许可证

这个项目是由MIT License授权的。

MIT License

Copyright (c) 2019 Niranjan Rajendran

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java如何使用Array和ArrayList做同样的事情?   用户界面使Java JScrollpane仅垂直滚动   查找字符串中最长的重复子字符串所需的算法Java函数?   java我想在listview中检索firebase数据   java如何使用Jsoup提取链接?   java 安卓。看法使用RTEditor时发生充气异常   maven为什么自动依赖是错误版本?(java.lang.ClassNotFoundException:org.junit.jupiter.api.MethodOrderContext)   使用apachespark进行java开发   java glDrawBuffers是否应该翻转IntBuffer?   java在添加回调之前完成CompletableFuture<T>   用Java构建搜索树   java将web应用程序部署到Heroku   active directory Java LDAP:属性为只读   启动Spring启动应用程序时未考虑java DB端口   使用Mockito的java模拟   C++从运行时运行java的过程。执行出口代码139   javascript使用脚本删除旧SonarQube项目   java代理每节点模型?   java无法在Android上通过Internet从PC服务器接收UDP数据   在bluemix:java上加载p12时发生ibm云错误。木卫一。IOException:数据不足