Giter Site home page Giter Site logo

parthfloyd / pymail Goto Github PK

View Code? Open in Web Editor NEW

This project forked from charlkie/pymail

0.0 0.0 0.0 188 KB

Python mail library for sending and receiving information from a users mailbox using the Gmail api.

License: MIT License

Python 81.70% HTML 10.91% TypeScript 7.39%

pymail's Introduction

PyMail

License

Future Plans:

  • 0.1.1 Update - Authenticate the user from the flask server, as a pose to checking credentials from a saved file. Add methods to delete specific messages/threads from users mailbox. Add parameter to enable compression of data before uploading to database.

Welcome to PyMail the mail module used in AtSchool's single page web application

This module is a python implementation of Google's Gmail API. It takes the key parts of an Email and uploads it to a GraphQL server. Solving the problem of slow 'fetching' from the Google servers by providing a faster was to query frequently used parts of the Gmail API.

Features

  • Get important parts of a email from Google servers: recipient, receiver, subject and body in plain text or HTML format.
  • Through GraphQL API uploads message parts to MongoDB.
  • Single page web application displaying the querying of email (significantly faster than querying from Google servers)

How To Run Server

  1. run python3 -m venv venv
  2. run source venv/bin/activate
  3. run pip3 intall -r requirements.txt
  4. run export FLASK_APP="app.py"
  5. run flask run

How To Run SPA

Before running Mobile application be sure to run the server

  1. run cd SPA
  2. run npm install, twice
  3. run yarn start

PyMail Documentation

To test all PyMail methods run: $ python3 mail_test.py

Methods

Gmail. Parameters Description
GetMessages().list() msgNum Fetches 'msgNum' message ID's from Google servers.
getMessageData() messages, format, log Gets all message data from a list of message ID's.
getPayload() msgData Gets the payload data from message data.
unpackPayload() payloads, bodies, types, log Gets important parts from payload: recipient, sender name, sender email, subject and body of email in plain text or html format.
sendMessage() to, from, subject, content sends an email from users mailbox

Parameters


Parameters Value Description
MsgNum integer The number of messages to be queried.
Messages list list of messages returned from getMessages.list method.
format string text format either default or raw
log boolean True, creates a directory wherein the return of the function is written to log files.
msgData list list of message data returned from getMessageData method.
payloads list list of payload parts of messages returned from getPayload method.
bodies boolean True to collect html or plain text bodies from payload, false. for simply headers
types list of strings types of bodies to be returned, either html or plain

pymail's People

Contributors

charlkie avatar

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.