Skip to main content

No description.

Project description

maida

自己写的一些库,目前只有一个发送邮件的功能。


安装

可以直接 pip 安装

pip install maida

mail

EmailSender

基于 smtplib 的发送邮件脚本

  1. 可以发送文本
  2. 可以发送图片
  3. 可以发送附件(图片、文件等),附件文件名可以包含中文
  4. 可以群发邮件

demo

email = EmailSender(email_host='smtp.qq.com', email_pass='xxx')
content = '这是lzc发送过来的邮件。请注意查收!'
email.init(from_addr='xxx@qq.com', to_addrs=['xxx@qq.com'], subject='测-试')
email.attach_text(text=content)
email.attach_file(r'C:\xxx\xx.jpg')
email.attach_file(r'C:\xxx\xx.txt')
email.send()
email.close()

scrapy

整合了 scrapy_mail 中的拓展,详情请到原始页面查看
scrapy 使用此拓展时可以直接引用,不用手动复制至 scrapy 同级目录

EXTENSIONS = {
    'lzc.extensions.closespider.CloseSpider': 200,
}

变更为

EXTENSIONS = {
    'maida.scrapy.extensions.closespider.CloseSpider': 200,
}

其他地方保持不变

版本历程

详见 history.md

Project details


Release history Release notifications

This version

0.1.1

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for maida, version 0.1.1
Filename, size & hash File type Python version Upload date
maida-0.1.1-py3-none-any.whl (7.8 kB) View hashes Wheel py3
maida-0.1.1.tar.gz (5.4 kB) View hashes Source None

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page