Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/zapier/email-reply-parser
:email: Email reply parser library for Python
https://github.com/zapier/email-reply-parser
featured
Last synced: 3 months ago
JSON representation
:email: Email reply parser library for Python
- Host: GitHub
- URL: https://github.com/zapier/email-reply-parser
- Owner: zapier
- License: mit
- Created: 2012-11-02T07:34:22.000Z (about 12 years ago)
- Default Branch: master
- Last Pushed: 2022-10-17T05:44:54.000Z (about 2 years ago)
- Last Synced: 2024-04-14T04:45:35.113Z (7 months ago)
- Topics: featured
- Language: Python
- Homepage:
- Size: 74.2 KB
- Stars: 476
- Watchers: 63
- Forks: 118
- Open Issues: 18
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Email Reply Parser for Python
A port of GitHub's Email Reply Parser library, by the fine folks at [Zapier](https://zapier.com/).## Summary
Email Reply Parser makes it easy to grab *only* the last reply to an on-going email thread.
Say you'd like to parse out a user's response to your transaction email messages:
```
Yes that is fine, I will email you in the morning.On Fri, Nov 16, 2012 at 1:48 PM, Zapier wrote:
> Our support team just commented on your open Ticket:
> "Hi Royce, can we chat in the morning about your question?"
```Email clients handle reply formatting differently, making parsing a pain. [We include tests for many cases](https://github.com/zapier/email-reply-parser/tree/master/test/emails). The parsed email:
```
Yes that is fine, I will email you in the morning.
```[![Build Status](https://secure.travis-ci.org/zapier/email-reply-parser.png?branch=master)](https://travis-ci.org/zapier/email-reply-parser)
## Installation
Using pip, use command:
```
pip install email_reply_parser
```## Tutorial
### How to parse an email message
Step 1: Import email reply parser package
```python
from email_reply_parser import EmailReplyParser
```Step 2: Provide email message as type String
```python
EmailReplyParser.read(email_message)
```### How to only retrieve the reply message
Step 1: Import email reply parser package
```python
from email_reply_parser import EmailReplyParser
```Step 2: Provide email message as type string using parse_reply class method.
```python
EmailReplyParser.parse_reply(email_message)
```