Skip to main content

Offer a uniform interface for free temp mail.

Project description

临时邮箱 UtMail

Github Stars Github Forks Code-size version

本项目旨在收集临时邮箱的接口,并提供统一的方法调用

  • 欢迎使用本项目

  • 欢迎开发者为本项目接入新的接口

使用方法

下载并导入库

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的字典
  • read_mail(MID): 读取邮件,返回元组

    • arg:
      • MID=(str) 从get_inbox()返回值中获得MID,通过MID读取邮件详细信息
    • return:
      • tuple(状态码,邮件简介,邮件正文)
  • delete_mail(MID): 删除邮件,返回布鲁值

    • arg:
      • MID=(str) 参考read_mail()
    • return:
      • bool 删除是否成功

注意: 本库使用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接口

项目维护者

@Czy_4201b

版本建议

0.1.8之前的版本不一定能正常使用,建议使用版本>=0.1.8

开发者文档

Project details


Download files

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

Source Distribution

utmail-0.1.8.tar.gz (6.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

utmail-0.1.8-py3-none-any.whl (6.9 kB view details)

Uploaded Python 3

File details

Details for the file utmail-0.1.8.tar.gz.

File metadata

  • Download URL: utmail-0.1.8.tar.gz
  • Upload date:
  • Size: 6.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.9.20

File hashes

Hashes for utmail-0.1.8.tar.gz
Algorithm Hash digest
SHA256 2faf1b44ee84444e29a946a62172cc2d6f6e66afa4ed1b0c8fe1d6b3dc642ef5
MD5 514a4025b681573bdaabef2031fc0c5d
BLAKE2b-256 e420b2f4851f7085681af52f58c19aca9386315e5e98a488b1efe678562f0490

See more details on using hashes here.

File details

Details for the file utmail-0.1.8-py3-none-any.whl.

File metadata

  • Download URL: utmail-0.1.8-py3-none-any.whl
  • Upload date:
  • Size: 6.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.9.20

File hashes

Hashes for utmail-0.1.8-py3-none-any.whl
Algorithm Hash digest
SHA256 2e959bc2cf25f133656100f5c2d7902949b122b092e992c7d0ea125230a4ba02
MD5 3a8dfc1785cacea96dc8f03fc0ee9fbc
BLAKE2b-256 79db3ef61b50624fed7314783c53a19d7a2fdc98beb1758c5ab16a28ac5e79b6

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page