Skip to main content

Minimal wrapper to simplify the usage of the awesome ankiconnect anki addon.

Project description

py_ankiconnect

Minimal wrapper to simplify the usage of the awesome ankiconnect anki addon. I made this in about an hour to make it easy to interact with anki from my many python projects (see my other repos), as well as from the command line.

Installation

  • python -m pip install py-ankiconnect or git clone followed by python -m pip install -e .

How To

Using the command line

  • You can either call it using py_ankiconnect or python -m py_ankiconnect.
  • To see the help: py_ankiconnect --help (this will either print it using rich if installed or using the pager.)
  • Examples:
    • Get the list of tags: py_ankiconnect getTags | jq
    • Get info about Clozolkor: py_ankiconnect findModelsByName --modelNames ["Clozolkor"] | jq

Using python

from py_ankiconnect import PyAnkiconnect
akc = PyAnkiconnect()
# ^ You can set a different port or host there directly:
# akc = PyAnkiconnect(port=your_port)

# trigger a sync:
result = akc("sync")

# Get the list of all tags:
result = akc("getTags")

# Do some more advanced stuff:
akc(
    action="changeDeck",
    params={
        "cards": [
            1502098034045,
            1502098034048,
            1502298033753
            ],
        "deck": "Japanese::JLPT N3"
        },
)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

py_ankiconnect-0.1.0.tar.gz (31.7 kB view hashes)

Uploaded Source

Built Distribution

py_ankiconnect-0.1.0-py3-none-any.whl (32.1 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page