Extract actionable tasks from messy emails using Python.
- Extract task-like sentences
- Detect due dates
- Detect priority levels
- Clean JSON output
- CLI support
pip install mail2taskfrom mail2task import extract_tasks
email = """
Please submit the compliance report by Friday.
Schedule the onboarding meeting tomorrow.
"""
tasks = extract_tasks(email)
print(tasks)Create a text file:
Please submit the report by Friday.
Schedule the client call tomorrow.
Run:
mail2task sample_email.txtOutput:
[
{
"title": "submit the report by Friday.",
"due_date": "2026-05-29T00:00:00",
"priority": "normal",
"confidence": 0.9
}
]mail2task sample_email.txt --prettymail2task sample_email.txt --output tasks.jsonmail2task sample_email.txt --format jsonmail2task sample_email.txt --format csvmail2task sample_email.txt --format markdown- Email automation
- Productivity apps
- AI assistants
- CRM workflows
- Task management systems
- Sentence splitting
- Greeting/signature filtering
- Due date extraction
- Priority detection
- Confidence scoring
mail2task uses spaCy for:
- sentence segmentation
- tokenization
- action verb detection
- lightweight NLP parsing
mail2task can process raw email files directly.
mail2task sample_email.eml --prettymail2task/
├── src/
├── tests/
├── README.md
├── pyproject.toml
MIT License

