Skip to content

Commit

Permalink
Add koreader_highlights_2_anki script
Browse files Browse the repository at this point in the history
  • Loading branch information
lbesnard committed Oct 16, 2024
1 parent 501bb0b commit 24ff4ba
Show file tree
Hide file tree
Showing 7 changed files with 2,862 additions and 1 deletion.
144 changes: 144 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,144 @@
# Ignore the version file, it's created on install
aodn_cloud_optimised/_version.py


# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# node
/node_modules
node_modules
node
.serverless
**/static/static

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib64/
parts/
sdist/
var/
wheels/
pip-wheel-metadata/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# pyenv
.python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock

# PEP 582; used by e.g. github.com/David-OConnor/pyflow
__pypackages__/

# Celery stuff
celerybeat-schedule
celerybeat.pid

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/
/.idea

# subsetting-ui
/subsetting-ui/api/static/
pygeoapi/aodn-geoapi/resources/pygeoapi-api.yml
34 changes: 33 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,33 @@
# Koreader_Highlights_2_Anki
# Koreader_Highlights_2_Anki


## Installation with Poetry
Clone the repo
```bash
pip install poetry
poetry install
```

### Usage

```bash
poetry run koreader_highlights_2_anki -h
usage: koreader_highlights_2_anki [-h] --input-folder INPUT_FOLDER --output-folder OUTPUT_FOLDER [--deck-name DECK_NAME] [--no-ai] [--select-files]

Create Anki flashcards from Koreader highlights.

options:
-h, --help show this help message and exit
--input-folder INPUT_FOLDER, -i INPUT_FOLDER
Path to the folder containing metadata.epub.lua files in KOReader.
--output-folder OUTPUT_FOLDER, -o OUTPUT_FOLDER
Path to the folder where .apkg files will be saved.
--deck-name DECK_NAME, -n DECK_NAME
Name of the Anki deck (e.g., 'deck::subdeck') (Default to Books Highlights 📚 .
--no-ai Decide if we don't use AI to find which part of the sentence to 'cloze'.
--select-files If set, allows you to select files interactively for processing.
example:
poetry run koreader_highlights_2_anki -i /media/KOBOeReader/Ebooks -o ~/Documents --select-files
```
Loading

0 comments on commit 24ff4ba

Please sign in to comment.