inka


Nameinka JSON
Version 2.2.3 PyPI version JSON
download
home_pagehttps://github.com/keiqu/inka
SummaryCommand-line tool for adding flashcards from Markdown files to Anki
upload_time2023-04-28 09:08:03
maintainer
docs_urlNone
authorKirill Salnikov
requires_python>=3.10
licenseGPLv3
keywords anki markdown spaced-repetition
VCS
bugtrack_url
requirements mistune requests click rich aqt anki PyQt6 PyQt6-WebEngine tox pytest pytest-cov pytest-mock Pillow mypy types-click types-requests flake8 isort black
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # inka

[![Downloads](https://pepy.tech/badge/inka)](https://pepy.tech/project/inka)
[![PyPi](https://img.shields.io/pypi/v/inka)](https://pypi.org/project/inka)
[![Tests CI](https://img.shields.io/github/actions/workflow/status/keiqu/inka/test.yml?branch=main)](https://github.com/keiqu/inka/actions/workflows/test.yml)
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
[![Codecov](https://codecov.io/gh/keiqu/inka/branch/main/graph/badge.svg?token=9wW5SJ9uLL)](https://codecov.io/gh/keiqu/inka)

Automatically add your Markdown flashcards to [Anki](https://apps.ankiweb.net/).

- [Installation](#installation)
    - [Requirements](#requirements)
- [Why](#why)
- [Features](#features)
- [Usage](#usage)
    - [Creating Cards](#creating-cards)
    - [Adding Cards to Anki](#adding-cards-to-anki)

## Installation

Install **inka**:

```shell
python3 -m pip install inka --upgrade
```

### Requirements

- [Anki](https://apps.ankiweb.net/) >= 2.1.54
- [Python](https://www.python.org/) >= 3.10

## Why

I've been using Anki for a long time, and at some point my notes turned into just lists of question/answer pairs, from
which I then created Anki cards. The process of creating flashcards in Anki took a long time, so I decided to write a
Python script to automate it. With more and more features added, the script has evolved into the command-line tool you
can see now.

**inka** allows you to use full power of Markdown when creating flashcards. The program is also extensively tested.

## Features

- Cards are automatically added to your Anki deck
- [Basic and Cloze note types support](https://github.com/keiqu/inka/wiki/Creating-cards#frontback-notes)
- [Synchronization of changes with Anki](https://github.com/keiqu/inka/wiki/Synchronization-with-Anki)
- [Configuration via config file](https://github.com/keiqu/inka/wiki/Config)
- [Images support](https://github.com/keiqu/inka/wiki/Creating-cards#images)
- [MathJax support](https://github.com/keiqu/inka/wiki/Mathjax)
- [Code highlight](https://github.com/keiqu/inka/wiki/Code-highlight)
- [Hashing (for better performance)](https://github.com/keiqu/inka/wiki/Hashing)

## Usage

### Creating Cards

In order for the program to be able to separate cards from all the rest of the text in the file, you need to enclose
them between two `---`:

```markdown
---

Deck: Life Questions

Tags: learning life-questions

1. What is the answer to the Ultimate Question of Life, the Universe, and Everything?

> 42

2. If it {{c1::looks like a duck, swims like a duck, and quacks like a duck}}, then it is a {{c2::duck}}.

---
```

You can create any number of such sections in the file.

> :warning: This means that you should avoid using the `---` syntax anywhere else in the file for **inka** to work correctly.
> There are exceptions, and you can read about them in [documentation](https://github.com/keiqu/inka/wiki/Creating-cards#i-want-to-use-----for-other-purposes).

Inside the section, you can specify the name of the deck to which the cards will be added, and tags for the cards. If
deck name isn't specified, then the one from the [config](https://github.com/keiqu/inka/wiki/Config) is
used (`Default` by default). The deck name is written after `Deck:`, and tags for all cards after `Tags:` with spaces
between each tag.

Two types of notes are supported:

- **Front/Back**: every question starts with number followed by period (e.g. `1.`, `2.` - Markdown ordered list syntax)
  and every line of the answer starts with `>` (Markdown quote syntax). Question and answer can span multiple lines.
- **Cloze**: same as Front/Back notes, Cloze notes start with number followed by period (Markdown ordered list syntax).
  **inka** supports three versions of syntax for cloze deletions:
    - Anki syntax: `{{c1::hidden text}}`
    - Short explicit syntax: `{1::hidden text}` or `{c1::hidden text}`
    - Short implicit syntax: `{hidden text}`

More info and examples on the [creating cards](https://github.com/keiqu/inka/wiki/Creating-cards) documentation
page.

### Adding Cards to Anki

**inka** will create custom note types for **Front/Back** and **Cloze** notes. If you want to use different ones, you
can change note types in the [config](https://github.com/keiqu/inka/wiki/Config).

Add cards from the file:

```commandline
inka collect path/to/cards.md
```

Or from all *Markdown* files in a directory:

```commandline
inka collect path/to/directory
```

You can also pass multiple paths at once:

```commandline
inka collect path/to/cards.md path/to/folder
```

You can find more information on the [documentation page](https://github.com/keiqu/inka/wiki/Adding-cards-to-Anki).

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/keiqu/inka",
    "name": "inka",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.10",
    "maintainer_email": "",
    "keywords": "anki,markdown,spaced-repetition",
    "author": "Kirill Salnikov",
    "author_email": "salnikov.k54@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/e2/98/6719f47a186a9263c9c74fcd7763e5055f4dae101d7cedcf01b01c4ae9cb/inka-2.2.3.tar.gz",
    "platform": null,
    "description": "# inka\n\n[![Downloads](https://pepy.tech/badge/inka)](https://pepy.tech/project/inka)\n[![PyPi](https://img.shields.io/pypi/v/inka)](https://pypi.org/project/inka)\n[![Tests CI](https://img.shields.io/github/actions/workflow/status/keiqu/inka/test.yml?branch=main)](https://github.com/keiqu/inka/actions/workflows/test.yml)\n[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)\n[![Codecov](https://codecov.io/gh/keiqu/inka/branch/main/graph/badge.svg?token=9wW5SJ9uLL)](https://codecov.io/gh/keiqu/inka)\n\nAutomatically add your Markdown flashcards to [Anki](https://apps.ankiweb.net/).\n\n- [Installation](#installation)\n    - [Requirements](#requirements)\n- [Why](#why)\n- [Features](#features)\n- [Usage](#usage)\n    - [Creating Cards](#creating-cards)\n    - [Adding Cards to Anki](#adding-cards-to-anki)\n\n## Installation\n\nInstall **inka**:\n\n```shell\npython3 -m pip install inka --upgrade\n```\n\n### Requirements\n\n- [Anki](https://apps.ankiweb.net/) >= 2.1.54\n- [Python](https://www.python.org/) >= 3.10\n\n## Why\n\nI've been using Anki for a long time, and at some point my notes turned into just lists of question/answer pairs, from\nwhich I then created Anki cards. The process of creating flashcards in Anki took a long time, so I decided to write a\nPython script to automate it. With more and more features added, the script has evolved into the command-line tool you\ncan see now.\n\n**inka** allows you to use full power of Markdown when creating flashcards. The program is also extensively tested.\n\n## Features\n\n- Cards are automatically added to your Anki deck\n- [Basic and Cloze note types support](https://github.com/keiqu/inka/wiki/Creating-cards#frontback-notes)\n- [Synchronization of changes with Anki](https://github.com/keiqu/inka/wiki/Synchronization-with-Anki)\n- [Configuration via config file](https://github.com/keiqu/inka/wiki/Config)\n- [Images support](https://github.com/keiqu/inka/wiki/Creating-cards#images)\n- [MathJax support](https://github.com/keiqu/inka/wiki/Mathjax)\n- [Code highlight](https://github.com/keiqu/inka/wiki/Code-highlight)\n- [Hashing (for better performance)](https://github.com/keiqu/inka/wiki/Hashing)\n\n## Usage\n\n### Creating Cards\n\nIn order for the program to be able to separate cards from all the rest of the text in the file, you need to enclose\nthem between two `---`:\n\n```markdown\n---\n\nDeck: Life Questions\n\nTags: learning life-questions\n\n1. What is the answer to the Ultimate Question of Life, the Universe, and Everything?\n\n> 42\n\n2. If it {{c1::looks like a duck, swims like a duck, and quacks like a duck}}, then it is a {{c2::duck}}.\n\n---\n```\n\nYou can create any number of such sections in the file.\n\n> :warning: This means that you should avoid using the `---` syntax anywhere else in the file for **inka** to work correctly.\n> There are exceptions, and you can read about them in [documentation](https://github.com/keiqu/inka/wiki/Creating-cards#i-want-to-use-----for-other-purposes).\n\nInside the section, you can specify the name of the deck to which the cards will be added, and tags for the cards. If\ndeck name isn't specified, then the one from the [config](https://github.com/keiqu/inka/wiki/Config) is\nused (`Default` by default). The deck name is written after `Deck:`, and tags for all cards after `Tags:` with spaces\nbetween each tag.\n\nTwo types of notes are supported:\n\n- **Front/Back**: every question starts with number followed by period (e.g. `1.`, `2.` - Markdown ordered list syntax)\n  and every line of the answer starts with `>` (Markdown quote syntax). Question and answer can span multiple lines.\n- **Cloze**: same as Front/Back notes, Cloze notes start with number followed by period (Markdown ordered list syntax).\n  **inka** supports three versions of syntax for cloze deletions:\n    - Anki syntax: `{{c1::hidden text}}`\n    - Short explicit syntax: `{1::hidden text}` or `{c1::hidden text}`\n    - Short implicit syntax: `{hidden text}`\n\nMore info and examples on the [creating cards](https://github.com/keiqu/inka/wiki/Creating-cards) documentation\npage.\n\n### Adding Cards to Anki\n\n**inka** will create custom note types for **Front/Back** and **Cloze** notes. If you want to use different ones, you\ncan change note types in the [config](https://github.com/keiqu/inka/wiki/Config).\n\nAdd cards from the file:\n\n```commandline\ninka collect path/to/cards.md\n```\n\nOr from all *Markdown* files in a directory:\n\n```commandline\ninka collect path/to/directory\n```\n\nYou can also pass multiple paths at once:\n\n```commandline\ninka collect path/to/cards.md path/to/folder\n```\n\nYou can find more information on the [documentation page](https://github.com/keiqu/inka/wiki/Adding-cards-to-Anki).\n",
    "bugtrack_url": null,
    "license": "GPLv3",
    "summary": "Command-line tool for adding flashcards from Markdown files to Anki",
    "version": "2.2.3",
    "split_keywords": [
        "anki",
        "markdown",
        "spaced-repetition"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "5187c042bd184c61d31dca9778f73754537c6c93ca6122798f35bc45f396080f",
                "md5": "0dfd95312aa55da83e84ed52d84071b6",
                "sha256": "a75d94ceff4001e65a1a17248bae63a2177738fec0de3af3857a9868c6020a8e"
            },
            "downloads": -1,
            "filename": "inka-2.2.3-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "0dfd95312aa55da83e84ed52d84071b6",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.10",
            "size": 40382,
            "upload_time": "2023-04-28T09:08:02",
            "upload_time_iso_8601": "2023-04-28T09:08:02.293881Z",
            "url": "https://files.pythonhosted.org/packages/51/87/c042bd184c61d31dca9778f73754537c6c93ca6122798f35bc45f396080f/inka-2.2.3-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "e2986719f47a186a9263c9c74fcd7763e5055f4dae101d7cedcf01b01c4ae9cb",
                "md5": "d1c0e568d5a9175e7444200cf6950be1",
                "sha256": "3d29564c486d190f3a3f0f807ea9a7dae48034f825cd0c83497f9f66019ce9fa"
            },
            "downloads": -1,
            "filename": "inka-2.2.3.tar.gz",
            "has_sig": false,
            "md5_digest": "d1c0e568d5a9175e7444200cf6950be1",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.10",
            "size": 45309,
            "upload_time": "2023-04-28T09:08:03",
            "upload_time_iso_8601": "2023-04-28T09:08:03.716424Z",
            "url": "https://files.pythonhosted.org/packages/e2/98/6719f47a186a9263c9c74fcd7763e5055f4dae101d7cedcf01b01c4ae9cb/inka-2.2.3.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-04-28 09:08:03",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "github_user": "keiqu",
    "github_project": "inka",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [
        {
            "name": "mistune",
            "specs": [
                [
                    "==",
                    "2.0.5"
                ]
            ]
        },
        {
            "name": "requests",
            "specs": [
                [
                    "==",
                    "2.28.2"
                ]
            ]
        },
        {
            "name": "click",
            "specs": [
                [
                    "==",
                    "8.1.3"
                ]
            ]
        },
        {
            "name": "rich",
            "specs": [
                [
                    "==",
                    "13.3.3"
                ]
            ]
        },
        {
            "name": "aqt",
            "specs": [
                [
                    ">=",
                    "2.1.61"
                ]
            ]
        },
        {
            "name": "anki",
            "specs": [
                [
                    ">=",
                    "2.1.61"
                ]
            ]
        },
        {
            "name": "PyQt6",
            "specs": [
                [
                    "~=",
                    "6.5"
                ]
            ]
        },
        {
            "name": "PyQt6-WebEngine",
            "specs": [
                [
                    "~=",
                    "6.5"
                ]
            ]
        },
        {
            "name": "tox",
            "specs": [
                [
                    "==",
                    "4.4.8"
                ]
            ]
        },
        {
            "name": "pytest",
            "specs": [
                [
                    "==",
                    "7.2.0"
                ]
            ]
        },
        {
            "name": "pytest-cov",
            "specs": [
                [
                    "==",
                    "4.0.0"
                ]
            ]
        },
        {
            "name": "pytest-mock",
            "specs": [
                [
                    "==",
                    "3.10.0"
                ]
            ]
        },
        {
            "name": "Pillow",
            "specs": [
                [
                    "==",
                    "9.4.0"
                ]
            ]
        },
        {
            "name": "mypy",
            "specs": [
                [
                    "==",
                    "1.1.1"
                ]
            ]
        },
        {
            "name": "types-click",
            "specs": [
                [
                    "==",
                    "7.1.8"
                ]
            ]
        },
        {
            "name": "types-requests",
            "specs": [
                [
                    "==",
                    "2.28.11.17"
                ]
            ]
        },
        {
            "name": "flake8",
            "specs": [
                [
                    "==",
                    "6.0.0"
                ]
            ]
        },
        {
            "name": "isort",
            "specs": [
                [
                    "==",
                    "5.12.0"
                ]
            ]
        },
        {
            "name": "black",
            "specs": [
                [
                    "==",
                    "23.3.0"
                ]
            ]
        }
    ],
    "tox": true,
    "lcname": "inka"
}
        
Elapsed time: 0.06152s