Convert Adobe ACSM ebook files into clean Markdown. One command.
python3 acsm2md.py book.acsm
You get a folder of Markdown files — one per chapter, plus a combined full_book.md. Feed them to an LLM, drop them into Obsidian, read them in any editor, grep them, whatever you want.
When you borrow or buy an ebook from a library or retailer, you usually get a .acsm file — a tiny XML stub that Adobe Digital Editions uses to download the real book. ADE is bloated, Windows/Mac-only, and locks you into Adobe's ecosystem. On Linux it barely works under Wine.
This project chains together three steps that previously required separate tools:
.acsm file → Adobe fulfillment → DRM'd EPUB → DRM removal → clean Markdown
It uses the acsm-calibre-plugin by Leseratte10 (included, GPLv3) for the ACSM fulfillment, then decrypts the EPUB and extracts it to structured Markdown.
Install dependencies:
pip install lxml pycryptodome beautifulsoup4 oscryptoActivate an ADE account (one-time):
cd calibre-plugin
python3 register_ADE_account.pyThis creates activation.xml, device.xml, and devicesalt in the current directory. You can use your real AdobeID or create an anonymous authorization. Back up these files — if you lose them and used anonymous auth, your books are gone.
Basic — get Markdown from an ACSM file:
python3 acsm2md.py ~/Downloads/MyBook.acsmOutput goes to ./MyBook/ with per-chapter files and full_book.md.
Specify output directory:
python3 acsm2md.py book.acsm -o ~/notes/books/MyBook/Keep the intermediate EPUB files:
python3 acsm2md.py book.acsm --keep-epubASCII-safe output (curly quotes → straight quotes, em-dashes → --, etc.):
python3 acsm2md.py book.acsm --asciiMyBook/
├── 01_chapter1.md
├── 02_chapter2.md
├── 03_chapter3.md
├── ...
└── full_book.md # all chapters concatenated
Each chapter file has proper headings, paragraphs, blockquotes, and lists extracted from the EPUB HTML. No leftover <div> tags or inline styles.
If you just want ACSM → EPUB inside Calibre (without the Markdown step), the included calibre-plugin/ directory works as a standalone Calibre plugin:
- Run
./bundle_calibre_plugin.shto build the ZIP - In Calibre: Preferences → Plugins → Load plugin from file
- Authorize via plugin settings
- Drag
.acsmfiles into Calibre
See the plugin's original documentation for details on authorization methods, returning library books, and eReader support.
The calibre-plugin/ folder also has scripts you can run without Calibre:
register_ADE_account.py— authorize with an AdobeID (or anonymous)fulfill.py— download a book from an ACSM file (produces EPUB/PDF)get_key_from_Adobe.py— get your DRM decryption key as a.derfile
acsm2md.py ← the main pipeline script
calibre-plugin/ ← Leseratte10's ACSM plugin (fulfillment + DRM handling)
migration_plugin/ ← migration helper for older DeACSM versions
tests/ ← test suite
bundle_calibre_plugin.sh ← build script for Calibre plugin ZIP
requirements.txt ← Python dependencies
- Python 3.8+
lxml,pycryptodome,beautifulsoup4,oscrypto- An activated ADE account (via
register_ADE_account.py)
- Fulfillment — sends the ACSM file to Adobe's server, which returns a DRM-protected EPUB (or PDF). This uses the same protocol as Adobe Digital Editions.
- Decryption — extracts the book encryption key from your activation data, decrypts each resource in the EPUB using AES-CBC, and writes a clean EPUB without DRM metadata.
- Markdown extraction — parses the EPUB's OPF spine, reads each XHTML chapter through BeautifulSoup, and converts headings/paragraphs/lists/blockquotes to Markdown.
- PDF books: the pipeline handles EPUB only. If Adobe delivers a PDF, the fulfillment step will download it but the Markdown extraction won't run. You'll get the PDF in
--keep-epubmode. - Complex layouts (tables, math, code blocks) get simplified to plain text. This works well for prose-heavy books but not for technical references.
- Image extraction is not implemented yet — the Markdown references image paths but doesn't extract them from the EPUB.
The ACSM fulfillment and account management code is from acsm-calibre-plugin by Leseratte10 (Copyright 2021–2025), which is a Python reimplementation of libgourou by Grégory Soutadé.
GPLv3. See LICENSE.