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如何让用户决定按钮的特定颜色   java Tomcat jdbc连接池,使用后不释放连接   Java泛型类可分配性   javaactivemq&如何在路由路径中创建依赖关系   java为什么没有接收到操作用户?   windows如何启动使用cmd中预编译DLL的java swing应用程序?   java JFreechart实时组合图,在未收到数据点的情况下呈现step子图表的上一个值   java排序自定义数组列表   java如何从HSLFSlideShow获取文本格式信息   java不能将片段和活动登录结合起来   java是下载位于远程存储服务中的文件的有效方法   java AS:将点数交给GameOverActivity   java如何在textView中将焦点放在新生成文本的顶部?   HashMap中特定于Java存储的类类型   java使用不同的变量类型进行计算   if语句中的Java poll()   检查匹配括号的java字符堆栈没有错误,但也没有任何作用   java Netbeans不断将应用程序部署到错误的服务器