临时邮箱 UtMail
本项目旨在收集临时邮箱的接口,并提供统一的方法调用
-
欢迎使用本项目
-
欢迎开发者为本项目接入新的接口
使用方法
下载并导入库
Git方式
git clone --depth=1 https://github.com/SpeechlessMatt/UtMail.git
pip方式
pip install utmail
引用方法
from utmail import UtMail
对于临时收件箱,该库主要有以下方法:
-
get_account(): 连接邮箱服务器,申请临时邮箱地址
-
get_inbox(details): 获取收件箱,返回一个列表/字典
- arg:
- (可选)details=bool False则返回一个列表,仅包含列表,否则返回包含status_code,num的字典
- arg:
-
read_mail(MID): 读取邮件,返回元组
- arg:
- MID=(str) 从get_inbox()返回值中获得MID,通过MID读取邮件详细信息
- return:
- tuple(状态码,邮件简介,邮件正文)
- arg:
-
delete_mail(MID): 删除邮件,返回布鲁值
- arg:
- MID=(str) 参考read_mail()
- return:
- bool 删除是否成功
- arg:
注意: 本库使用loguru日志处理库,可以在主程序头部增加如下代码以关闭日志输出
import sys
from loguru import logger
logger.remove()
# 日志级别详情参考loguru库 这里最低级别为INFO
logger.add(sys.stderr, level="warning")
简单实例
from utmail import UtMail, ChacuoOption
import time
if __name__ == '__main__':
# 创建实例对象 调用api接口ChacuoOption()
tm = UtMail(ChacuoOption())
# 申请邮箱
name = tm.get_account()
while True:
# 获取收件箱
email_list = tm.get_inbox()
# 输出列表
print(email_list)
if len(email_list) != 0:
a = input("MID:")
# 读取邮箱
print(tm.read_mail(a))
for i in range(0, 10):
print(f"\r{10 - i}秒后自动刷新...", end="", flush=True)
time.sleep(1)
print("\r\n")
目前支持的API接口
- ChacuoOption(): 十分钟邮箱
项目维护者
版本建议
0.1.8之前的版本不一定能正常使用,建议使用版本>=0.1.8
开发者文档
Release files for utmail 0.1.8
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| utmail-0.1.8.tar.gz | 6.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| utmail-0.1.8-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 12.9 kB
Release files / utmail-0.1.8.tar.gz
| Download URL | utmail-0.1.8.tar.gz |
|---|---|
| Size | 6.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2faf1b44ee84444e29a946a62172cc2d6f6e66afa4ed1b0c8fe1d6b3dc642ef5
|
|
BLAKE2b-256 checksum How to use checksums |
e420b2f4851f7085681af52f58c19aca9386315e5e98a488b1efe678562f0490
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.9.20
|
Release files / utmail-0.1.8-py3-none-any.whl
| Download URL | utmail-0.1.8-py3-none-any.whl |
|---|---|
| Size | 6.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2e959bc2cf25f133656100f5c2d7902949b122b092e992c7d0ea125230a4ba02
|
|
BLAKE2b-256 checksum How to use checksums |
79db3ef61b50624fed7314783c53a19d7a2fdc98beb1758c5ab16a28ac5e79b6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.9.20
|