polyglot.markdown.kindle_notebook (class)

class polyglot.markdown.kindle_notebook(log, kindleExportPath, outputPath)[source]

convert the HTML export of kindle notebooks (from kindle apps) to markdown

Key Arguments:
  • log – logger
  • kindleExportPath – path to the exported kindle HTML file
  • outputPath – the output path to the md file.

Usage:

To convert the exported HTML file of annotation and notes from a kindle book or document to markdown, run the code:

from polyglot.markdown import kindle_notebook
nb = kindle_notebook(
    log=log,
    kindleExportPath="/path/to/kindle_export.html",
    outputPath="/path/to/coverted_annotations.md"
)
nb.convert()

The colours of the annotations convert to markdown attributes via the following key:

__init__(log, kindleExportPath, outputPath)[source]

Methods

__init__(log, kindleExportPath, outputPath)
clean(text)
convert() convert the kindle_notebook object
convertToMD(kindleNote)
find_component(divtag, annotations)