Coder Social home page Coder Social logo

secemailapi's Introduction

SecEmailApi

Данный файл представляет собой модуль для работы c API https://www.1secmail.com/api/

Функции:

from api import Email

# Получаем список почт.

emails = Email.get_email(3)  # Result: ['[email protected]', '[email protected]', '[email protected]']

# Проверяем, есть ли сообщения на почте. Возвращает пустой список если нету писем

messages = Email.check_mailbox(emails[0]) # Result: [{'id': 190556001, 'from': '[email protected]', 'subject': '123', 'date': '2021-05-17 13:39:01'}] 

# Получаем подробную информациб о письме по  его id

message = Email.fetching_message(email[0], 190556001) # Result: {'id': 190556001, 'from': '[email protected]', 'subject': '123', 'date': '2021-05-17 13:39:01', 'attachments': [], 'body': '', 'textBody': '\n\xa0\nПроверка\n\xa0\n--\nАртём Сапгиров', 'htmlBody': ''}

# Получаем фаил из письма

file = Email.attachment_download(email[0], 190556001, 'FILE_NAME') # Возвращает файл

# Echo функция, ожидает входящее письмо, и возвращает полное его содержимое
	
message = Email.message_handler(email[0]) # Result: {'id': 190556001, 'from': '[email protected]', 'subject': '123', 'date': '2021-05-17 13:39:01', 'attachments': [], 'body': '', 'textBody': '\n\xa0\nПроверка\n\xa0\n--\nАртём Сапгиров', 'htmlBody': ''}
	

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.