Kindle to Markdown converts Kindle notes and highlights exported by Bookcision as JSON into Markdown.
- Ensure pip is installed.
pip install kindle-to-md
To export your Kindle notes and highlights using Bookcision:
- Install Bookcision.
- View your notes an highlights on Amazon.
- Run the Bookcision bookmarklet.
- Select Download | as JSON from the Bookcision menu.
To convert your notes to Markdown:
- In terminal, run
kindle-to-md {downloaded_notes.json} {output_file.md}
- You can also run
kindle-to-md {downloaded_notes.json}
to output the notes to terminal.
To import to another Python script:
import kindle_to_md
To submit a bug report or make a feature request, create an issue on the GitHub repostitory.
The development repository is located at https://github.com/mikethicke/kindletomd.
Pull Requests should be accompianed by unit tests that fail before the changes are merged and pass afterwards.
This project follows Google's Python Style Guide.
This package uses a src layout, so you will have to build and install the package locally to run the tests.
Sample development workflow (for MacOS / Linux):
- Clone the repository:
git clone https://github.com/mikethicke/kindletomd.git
- Change to your repository directory:
cd kindletomd
- Create a virtual environment:
python3 -m venv venv
- Activate the virtual environment:
source venv/bin/activate
- Install development dependencies:
pip install -r requirements.txt
- Write test or tests that fail for the bug you are addressing or feature you are developing. Tests are located in the
tests
directory. Avoid putting test data directly in the unit tests themselves. Instead, put data intest-data
directory or inconftest.py
. This makes it easier to reuse data in other tests. If your test addresses a specific issue, reference the issue in the test's docblock. - Build the package:
python -m build
- Install the package locally:
pip install dist/{pacakge}.tar.gz
- Run pytest:
cd tests
pytest
- Your tests should fail and none others should.
- Implement your changes.
- Rebuild the package.
- Reinstall the package.
- Re-run pytest and confirm your changes cause your tests to pass.
- Commit your changes and open a Pull Request on Github to merge your changes.