Code Monkey home page Code Monkey logo

chronicle-email's Introduction

Chronicle::Email

Gem Version

Extract and work with your email using the command line with this plugin for chronicle-etl.

Usage

# Install chronicle-etl and this plugin
$ gem install chronicle-etl
$ chronicle-etl plugins:install email

Extracting email from IMAP

For Gmail accounts, you can create an app password; your email address is your username.

# Save username and password
$ chronicle-etl secrets:set imap username [email protected]
$ chronicle-etl secrets:set imap password APPPASSWORD

# Then, retrieve your email from the last five days
$ chronicle-etl --extractor email:imap --schema chronicle --since 5d

# If you don't want to save your credentials as a secret, you can just pass
# them to the extractor directly
$ chronicle-etl --extractor email:imap --schema chronicle --since 5d --loader json \
    --extractor-opts username:[email protected] --password:APPPASSWORD

Processing email from an .mbox file

The MBOX format is used to archive an email mailbox. Google Takeout exports emails from gmail in this format.

# Retrieve the subject lines of all emails in test.mbox
$ chronicle-etl --extractor email:mbox --input ~/Downloads/inbox.mbox --fields subject

Available Connectors

Extractors

imap

Extractor for importing recent emails from an IMAP server.

Settings
  • since: Retrieve emails since this date
  • until: Retrieve emails until this date
  • username
  • password
  • host: (default: imap.gmail.com)
  • port: (default: 993) Use 143 for unencrypted connections
  • mailbox: (default: "[Gmail]/All Mail")
  • search_query: When using Gmail, you can pass in a search query (from:foo has:attachment) to filter messages by

For accessing Gmail, you can create a one-time app password. Your email address is your username.

mbox

Extractor for importing emails from an MBOX file

Settings
  • input: A path to an .mbox file

Transformers

email

Transform an email (in the form of a string) into Chronicle Schema

Settings
  • body_as_markdown: (default: false) Whether to convert the email body into markdown
  • remove_signature: (default: true) Whether to attempt to strip out the email signature (using the email_reply_parser gem)

chronicle-email's People

Contributors

hyfen avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

chronicle-email's Issues

Mbox loader

Scenario: load email from IMAP and save it into a local .mbox file

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.