https://github.com/j6k4m8/epistolary Skip to content Navigation Menu Toggle navigation Sign in * Product + Actions Automate any workflow + Packages Host and manage packages + Security Find and fix vulnerabilities + Codespaces Instant dev environments + GitHub Copilot Write better code with AI + Code review Manage code changes + Issues Plan and track work + Discussions Collaborate outside of code Explore + All features + Documentation + GitHub Skills + Blog * Solutions By size + Enterprise + Teams + Startups By industry + Healthcare + Financial services + Manufacturing By use case + CI/CD & Automation + DevOps + DevSecOps * Resources Topics + AI + DevOps + Security + Software Development + View all Explore + Learning Pathways + White papers, Ebooks, Webinars + Customer Stories + Partners * Open Source + GitHub Sponsors Fund open source developers + The ReadME Project GitHub community articles Repositories + Topics + Trending + Collections * Enterprise + Enterprise platform AI-powered developer platform Available add-ons + Advanced Security Enterprise-grade security features + GitHub Copilot Enterprise-grade AI features + Premium Support Enterprise-grade 24/7 support * Pricing Search or jump to... Search code, repositories, users, issues, pull requests... Search [ ] Clear Search syntax tips Provide feedback We read every piece of feedback, and take your input very seriously. [ ] [ ] Include my email address so I can be contacted Cancel Submit feedback Saved searches Use saved searches to filter your results more quickly Name [ ] Query [ ] To see all available qualifiers, see our documentation. Cancel Create saved search Sign in Sign up Reseting focus You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session. Dismiss alert {{ message }} j6k4m8 / epistolary Public * Notifications You must be signed in to change notification settings * Fork 0 * Star 17 License Apache-2.0 license 17 stars 0 forks Branches Tags Activity Star Notifications You must be signed in to change notification settings * Code * Issues 3 * Pull requests 0 * Actions * Projects 0 * Security * Insights Additional navigation options * Code * Issues * Pull requests * Actions * Projects * Security * Insights j6k4m8/epistolary This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository. main BranchesTags Go to file Code Folders and files Name Name Last commit message Last commit date Latest commit History 19 Commits docs docs epistolary epistolary .gitignore .gitignore LICENSE LICENSE README.md README.md pyproject.toml pyproject.toml uv.lock uv.lock View all files Repository files navigation * README * Apache-2.0 license epistolary I find writing emails to be one of the most tedious and unpleasant tasks of my day. But I find the act of handwriting to be one of the most pleasant! The reMarkable is an e-ink tablet with a very pleasant writing experience. This software allows you to respond to emails by writing on the reMarkable, and then sends an OCR'd version of your writing to the recipient. --------------------------------------------------------------------- See docs/Overview.md for an example! --------------------------------------------------------------------- This tool is designed to "print" emails to a PDF file (one thread per file), with a blank (ruled) page after each email. You can write a reply to the email on the blank page, and Epistolary will convert your handwriting to text and send it as a reply to the email. It is originally designed to be used with the Remarkable tablet, which is a great device for reading and annotating PDFs, but it should work with standalone PDFs, tablet devices, or scanned documents as well. Architecture The tool comprises three main components: * MailboxManager: A class that manages the mailbox, and provides methods to get the next email to be printed, and to send a reply to an email. * DocumentManager: A class that manages the PDF document library. * EpistolaryOrchestrator: A class that manages the interaction between the MailboxManager and the DocumentManager, and provides OCR and main entry point functionality. Installation 0. Requirements If you are using the tesseract OCR option, you must first install Tesseract for OCR. On MacOS, this can be done with brew install tesseract. If you are using the OpenAI OCR option, you should configure your OpenAI API key globally, or you can pass it in a config to the TextExtractor directly. If you are planning to use the reMarkable document management tools, you will also need to install the rmapi tool and configure it with your reMarkable account. 1. Install the package Then install Python dependencies: uv install 2. Configure the package Create a ~/.config/epistolary.json file. (This is optional but recommended so that you don't have to put your password in the Python kernel directly.) { "email": "####", "password": "####", "imap": { "host": "####", "port": 993 }, "smtp": { "host": "####", "port": 587 } } 3. Run the package Here's an example of a Python script that uses the package: from epistolary.orchestrator import EpistolaryOrchestrator from epistolary.mailbox_manager import SMTPIMAPMailboxManager from epistolary.document_manager.remarkable_document_manager import RemarkableDocumentManager from epistolary.text_extractor.openai_text_extractor import OpenAITextExtractor EO = EpistolaryOrchestrator( SMTPIMAPMailboxManager.from_file(), RemarkableDocumentManager(), text_extractor=OpenAITextExtractor(), debug=True, ) EO.refresh_document_mailbox() And to send: EO.send_outbox() Note that the SMTPIMAPMailboxManager uses the epistolary.json file to get the email and password, and the RemarkableDocumentManager uses the rmapi tool to manage the reMarkable documents (which depends upon a ~/.rmapi file with your reMarkable credentials). If you do not choose to use the #from_file() method, you can pass in the email, password, and other parameters directly to the SMTPIMAPMailboxManager constructor. Known Limitations * No support for inline images or attachments yet... But it should be easy to add! * Spacing and formatting of the OCR'd text is not perfect, but it's usually good enough for a quick reply. About No description, website, or topics provided. Resources Readme License Apache-2.0 license Activity Stars 17 stars Watchers 1 watching Forks 0 forks Report repository Releases No releases published Packages 0 No packages published Languages * Python 100.0% Footer (c) 2024 GitHub, Inc. Footer navigation * Terms * Privacy * Security * Status * Docs * Contact * Manage cookies * Do not share my personal information You can't perform that action at this time.