A command-line utility to convert a BibTeX (.bib) file into an mbox email archive. Each BibTeX entry becomes an email message, making your reference library searchable and readable in any standard email client.
- Author as Sender: The
authorfield becomes the email's "From" address. - Title as Subject: The
titlefield becomes the email's "Subject". - Abstract as Body: The
abstractfield becomes the main body of the email. - Link Extraction: Automatically appends
urlanddoilinks to the end of the email body. - LaTeX to Text: Converts common LaTeX commands (e.g.,
{\'e},\textit{...},{...}) into clean, readable plain text. - Progress Bar: Shows a progress bar via
tqdmwhen processing large files.
You can install the tool directly from PyPI using pip:
bash pip install bibtex2mbox
The script is a command-line tool. You must provide the path to your input BibTeX file and the desired path for the output mbox file. You can download a specific BibTeX file from the ADS site, selecting "BibTeX-ABS" as download option.
bibtex2mbox [INPUT_BIB_FILE] [OUTPUT_MBOX_FILE]You can use any BibTeX file, as long as it is in the correct format. For example you can download one from the ADS library. Make sure you also export the abstract by selecting BibTeX ABS format from the menu. Unfortunately ADS allows only 500 entries at the time, so you will have to download large libraries with multiple downloads. The good news is that bibtex2mbox will add them (if you keep the same mbox output), resulting in one big mbox.
Let's say you have a file named my_library.bib in your current directory. To convert it into an archive named my_archive.mbox, you would run:
bibtex2mbox my_library.bib my_archive.mboxYou will see the following output as the tool processes your file:
Found 150 entries in 'my_library.bib'. Starting conversion...
Converting entries: 100%|██████████| 150/150 [00:00<00:00, 850.12entry/s]
Successfully converted 150 entries into 'my_archive.mbox'.The file my_archive.mbox will be created in your current directory.
Here are instructions for common clients.
- Install Add-on: In Thunderbird, go to
Tools > Add-ons and Themes, search for and installImportExportTools NG, then restart. - Import: Right-click on Local Folders, navigate to
ImportExportTools NG > Import mbox file, choose "Import directly one or more mbox files", and select your.mboxfile.
- Open Import Wizard: Go to
File > Import Mailboxes.... - Select Format: Choose "Files in mbox format" and click "Continue".
- Choose File: Navigate to and select your
.mboxfile. It will appear in a new "Import" folder under "On My Mac".
These clients do not directly support mbox imports. The recommended method is to use Thunderbird as an intermediary:
- Import the mbox into Thunderbird's "Local Folders".
- Set up your Outlook/Gmail account in Thunderbird via IMAP.
- Drag and drop the messages from the local mbox folder to a folder in your Outlook/Gmail account. Thunderbird will upload them.