Skip to main content

SWECC Email Scraper

A Python CLI tool for analyzing email data in mbox format.

Features

  • 📧 Process mbox format email archives
  • 🔧 Unix-style pipeline architecture for flexible processing
  • 📊 Extendable framework for building analysis pipelines
  • Coming soon: More analysis processors...

Installation

From PyPI

pip install swecc-email-scraper

From Source

git clone https://github.com/swecc-uw/swecc-email-scraper.git
cd swecc-email-scraper
pip install -e ".[dev]"  # Install with development dependencies

# Run tests
pytest

Quick Start

The tool uses Unix pipes to compose commands. Each command does one thing and can be combined with others:

  1. Basic usage - get email stats with example processor:
swecc-email-scraper read mailbox.mbox \
  | swecc-email-scraper stats \
  | swecc-email-scraper format -f json > results.json
  1. List available processors:
swecc-email-scraper list-processors
  1. List available output formats:
swecc-email-scraper list-formats

Command Reference

Read Command

Reads an mbox file and outputs email data as JSON:

swecc-email-scraper read input.mbox > emails.json

Stats Command

Processes email data from stdin and outputs statistics:

cat emails.json | swecc-email-scraper stats > stats.json

Format Command

Formats JSON data using the specified formatter:

cat stats.json \
  | swecc-email-scraper format -f json \
  > formatted.json

Pipeline Examples

  1. Basic email statistics to terminal:
swecc-email-scraper read inbox.mbox \
  | swecc-email-scraper stats \
  | swecc-email-scraper format
  1. Save analysis to a file:
swecc-email-scraper read inbox.mbox \
  | swecc-email-scraper stats \
  > analysis.json
  1. Process with custom formatting:
swecc-email-scraper read inbox.mbox \
  | swecc-email-scraper stats \
  | swecc-email-scraper format -f json \
  > analysis.json
  1. Use with Unix tools:
# Filter emails before analysis
swecc-email-scraper read inbox.mbox \
  | jq 'map(select(.sender | contains("important")))' \
  | swecc-email-scraper stats

Extending the Tool

The tool is designed to be easily extensible. See CONTRIBUTING.md for detailed information on:

  • Creating custom processors
  • Adding new output formats
  • Contributing to the project
  • Development setup and guidelines

Architecture

The tool uses a Unix pipeline architecture where:

  1. read command converts mbox files to JSON email data
  2. Processor commands (like stats) transform or analyze the data
  3. format command handles output formatting
  4. Standard Unix pipes (|) connect the components

License

MIT License - See LICENSE file for details.

Acknowledgments

Developed as part of SWECC Labs at the University of Washington.

Metadata

Release files for swecc-email-scraper 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for swecc-email-scraper 0.1.2
File Size Uploaded Provenance Actions
swecc_email_scraper-0.1.2.tar.gz 9.4 kB Without provenance Details for swecc_email_scraper-0.1.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for swecc-email-scraper 0.1.2
File Interpreter ABI Platform Actions
swecc_email_scraper-0.1.2-py3-none-any.whl Python 3 none any Details for swecc_email_scraper-0.1.2-py3-none-any.whl

Total release size: 18.1 kB

Release files / swecc_email_scraper-0.1.2.tar.gz

Download URL swecc_email_scraper-0.1.2.tar.gz
Size 9.4 kB
Tags Source
SHA-256 checksum
How to use checksums
e299c61d9c681f8f4d65131659be60739bc9664df33a2dd5aad7e53cb213c897
BLAKE2b-256 checksum
How to use checksums
5320f44cffaeb2f7796b0ac8fae0fa8a37767c8998fa096cba484e906d943ad1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.11.11

Release files / swecc_email_scraper-0.1.2-py3-none-any.whl

Download URL swecc_email_scraper-0.1.2-py3-none-any.whl
Size 8.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
72c1b86abfedda1a5e85fc90f3c32c30dcb3eae873793d4100687e0bd46adba1
BLAKE2b-256 checksum
How to use checksums
ef3612122affcece4df15d5031c70e67731ab91d21b45c7d2b342ed216f37181
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.11.11

Security for swecc-email-scraper 0.1.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page