Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/simonw/mbox-to-sqlite
Load email from .mbox files into SQLite
https://github.com/simonw/mbox-to-sqlite
email mbox sqlite
Last synced: 4 months ago
JSON representation
Load email from .mbox files into SQLite
- Host: GitHub
- URL: https://github.com/simonw/mbox-to-sqlite
- Owner: simonw
- License: apache-2.0
- Created: 2022-05-31T18:31:44.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-10-24T00:01:42.000Z (over 1 year ago)
- Last Synced: 2024-10-06T20:22:20.868Z (5 months ago)
- Topics: email, mbox, sqlite
- Language: Python
- Homepage:
- Size: 8.79 KB
- Stars: 24
- Watchers: 2
- Forks: 5
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# mbox-to-sqlite
[](https://pypi.org/project/mbox-to-sqlite/)
[](https://github.com/simonw/mbox-to-sqlite/releases)
[](https://github.com/simonw/mbox-to-sqlite/actions?query=workflow%3ATest)
[](https://github.com/simonw/mbox-to-sqlite/blob/master/LICENSE)Load email from .mbox files into SQLite
## Installation
Install this tool using `pip`:
pip install mbox-to-sqlite
## Usage
Use the `mbox` command to import a `.mbox` file into a SQLite database:
mbox-to-sqlite mbox emails.db path/to/messages.mbox
You can try this out against an example containing a sample of 3,266 emails from the [Enron corpus](https://en.wikipedia.org/wiki/Enron_Corpus) like this:
curl -O https://raw.githubusercontent.com/ivanhb/EMA/master/server/data/mbox/enron/mbox-enron-white-s-all.mbox
mbox-to-sqlite mbox enron.db mbox-enron-white-s-all.mboxYou can then explore the resulting database using [Datasette](https://datasette.io/):
datasette enron.db
## Development
To contribute to this tool, first checkout the code. Then create a new virtual environment:
cd mbox-to-sqlite
python -m venv venv
source venv/bin/activateNow install the dependencies and test dependencies:
pip install -e '.[test]'
To run the tests:
pytest