Coder Social home page Coder Social logo

imaper's Introduction

Imaper

IMAP made easy.

License: MIT
Documentation: http://pythonhosted.org/imaper/

This library is inspired by Imbox.

Example

from imaper import Imaper

mailbox = Imaper(
    hostname='imap.foo.com',
    username='[email protected]',
    password='password'
)

print "Messages ({0}/{1})".format(mailbox.unread_count(), mailbox.message_count())
print "=" * 80

# Imaper.messages() returns a generator, but I want a list
messages = list(mailbox.messages(unread=True))

for msg in messages:
    print "Subject: {0}".format(msg.subject)
    print "Body:\n{0}".format(msg.body['plain'][0])
    print "-" * 80

    # Mark it as read
    msg.mark_read()

# Delete the first message
messages[0].delete()

Install

Install From PyPi

pip install imaper

Install From Git

Clone the Repository:

$ git clone https://bitbucket.org/dhrrgn/imaper.git

Install Requirements:

$ cd imaper
$ pip install -r requirements.txt

Local Documentation

Install Fabric if you do not have it install already (pip install Fabric).

From the repository's root run:

$ fab requirements:docs
$ fab gendocs

The documentation will be located in docs/_build

imaper's People

Contributors

dhrrgn avatar quard avatar

Watchers

 avatar Django Stars avatar Roman Osipenko avatar James Cloos avatar Oleg Kovalyov avatar Artur Bachynskyi 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.