# 배우다 - Beauda - Learn - Apprendre
Create Anki deck and Card from your markdown files
## :package: Installation
pandoc is required on you system to allow to convert html content into markdown
### Requirements
* python 3.10+
* httpx
* pypandoc
* beautifulsoup4
### Install the project
create a virtualenv
```bash
python3 -m venv baeuda
cd baeuda
source bin/activate
```
clone the project
```bash
git clone https://github.com/foxmask/baeuda.git
cd baeuda
```
or
```bash
pip install baeuda
```
### Settings
edit `settings.py`
```ini
# from which folder does baeuda read the note to create into anki ?
# FOLDER = '/home/foxmask/MesNotes/Corée🇰🇷/공부/Kimchi!/'
# FOLDER = '/home/foxmask/MesNotes/Corée🇰🇷/공부/Cours - Active Korean 1 - 2020-2021'
# FOLDER = '/home/foxmask/MesNotes/Corée🇰🇷/공부/Cours - Active Korean 2 - 2021-2022'
# FOLDER = '/home/foxmask/MesNotes/Corée🇰🇷/공부/Cours - Active Korean 3 - 2022-2023'
FOLDER = '/home/foxmask/MesNotes/Corée🇰🇷/공부/Cours - Active Korean 4 - 2023-2024'
# FOLDER = '/path/to/your/markdown/files'
# PYPANDOC_MARKDOWN = 'markdown_github'
PYPANDOC_MARKDOWN = 'gfm'
ANKI_URL = 'http://localhost:8765/' # url provided by AnkiConnect https://ankiweb.net/shared/info/2055492159
# anki deck name is made by the first H1 of the Markdown
# anki deck are named : "Book name - Unit X - unit title"
#
# ANKI_DECK = 'Active Korean 3 - Unit 1'
ANKI_MODEL = "Korean (2 colonnes foxmask)" # Coréen / Français
ANKI_FIELD_COUNT = 2 # number of columns to grab from a markdown table
ANKI_FIELDS = ['Coréen', 'Français', ] # put the name of the fields you want to use with the "ANKI_MODEL"
# ANKI_MODEL = 'Korean (foxmask)' # fields are front/back/romanisation
# ANKI_FIELD_COUNT = 3 # number of columns to grab from a markdown table
# ANKI_FIELDS = ['Coréen', 'Romanisation', 'Français']
DATASOURCE = 'MdFile' # MdFile
```
## :dvd: DataSource
### Markdown files
The name of the file should have to be that way:
`foobar - xxx - yyy.md`
for example
`Kimchi! 01 - insa - 인사.md`
Baeuda will create note with xxx and yyy as tag in anki.
In our example : `insa` and `인사`
## Format of notes for Anki
To process, all the markdown files should have, at least, those content structure:
* h1 with the title of your markdown file
* h2 with tags name (optional)
* table with same headers name of the "fields" defined in the "anki type of note"
Let's see with an example :
In anki, among the provided types of notes, you can find "basic" which content 2 fields "recto" and "verso"
so in your markdown file you will have to create tables with headers named *recto* and *verso*
```
Title of the note - Topic - details
Recto | Verso
-------- | --------
Color on the sun ? | Yellow
Universal reply ? | 42
```
real example with three columns
```
Kimchi! Fiche 1 - 인사 - insa - salutations
Coréen | Romanisation | Français
------ | ------------ | --------
안녕하세요 | annyeonghaseyo | bonjour
```
## Anki desktop
To add cards to Anki, you need to use an existing model (also known as "type of notes")
There are many models you can use, if none fit your needs, you can create on as I did :
`tools > type of notes` then `add` button and choose `Duplicate Basic (and reversed card)` then we'll add a third fields `Romanisation` and will change `Front` to `Coreen` and `Back` to `Français`
Then add this addon [AnkiConnect](https://foosoft.net/projects/anki-connect/index.html#installation) to allow Anki to allow us to add the notes with the current script.
## Let's Go
First of all, start Anki on your desktop
### simulated process
```bash
python baeuda/run.py -a report
```
will display a table of all the grabbed data to create card
### creating cards
```bash
python baeuda/run.py -a go
```
during the execution, you can have a look in anki and see the decks created and receiving cards ;)
## From Markdown file to Anki in images
2) baeuda running in the console
![Anki integration](https://raw.githubusercontent.com/foxmask/baeuda/master/anki_integration.png)
3) Anki with the new created decks
![Anki Decks List](https://raw.githubusercontent.com/foxmask/baeuda/master/anki_list_decks.png)
4) the cards of the deck
![Anki The Deck](https://raw.githubusercontent.com/foxmask/baeuda/master/anki_deck.png)
5) one card
![Anki The card](https://raw.githubusercontent.com/foxmask/baeuda/master/anki_card.png)
(Image credits to [Emojipedia](https://emojipedia.org/))
Raw data
{
"_id": null,
"home_page": "https://github.com/foxmask/baeuda",
"name": "baeuda",
"maintainer": null,
"docs_url": null,
"requires_python": null,
"maintainer_email": null,
"keywords": "anki card markdown",
"author": "\ud3ed\uc2a4\ub9c8\uc2a4\ud06c",
"author_email": "foxmask+git@pm.me",
"download_url": "https://files.pythonhosted.org/packages/4c/90/a48051b57210e56c9ec32c3870f8052cf6d24f5760be5d80b73aee8b65d8/baeuda-0.5.0.tar.gz",
"platform": null,
"description": "# \ubc30\uc6b0\ub2e4 - Beauda - Learn - Apprendre\n\nCreate Anki deck and Card from your markdown files\n\n\n## :package: Installation\n\npandoc is required on you system to allow to convert html content into markdown\n\n### Requirements\n\n* python 3.10+\n* httpx\n* pypandoc\n* beautifulsoup4\n\n### Install the project\n\ncreate a virtualenv\n\n```bash\npython3 -m venv baeuda\ncd baeuda\nsource bin/activate\n```\n\nclone the project\n\n```bash\ngit clone https://github.com/foxmask/baeuda.git\ncd baeuda\n```\n\nor\n\n```bash\npip install baeuda\n```\n\n### Settings\n\nedit `settings.py`\n\n```ini\n# from which folder does baeuda read the note to create into anki ?\n# FOLDER = '/home/foxmask/MesNotes/Cor\u00e9e\ud83c\uddf0\ud83c\uddf7/\uacf5\ubd80/Kimchi!/'\n# FOLDER = '/home/foxmask/MesNotes/Cor\u00e9e\ud83c\uddf0\ud83c\uddf7/\uacf5\ubd80/Cours - Active Korean 1 - 2020-2021'\n# FOLDER = '/home/foxmask/MesNotes/Cor\u00e9e\ud83c\uddf0\ud83c\uddf7/\uacf5\ubd80/Cours - Active Korean 2 - 2021-2022'\n# FOLDER = '/home/foxmask/MesNotes/Cor\u00e9e\ud83c\uddf0\ud83c\uddf7/\uacf5\ubd80/Cours - Active Korean 3 - 2022-2023'\nFOLDER = '/home/foxmask/MesNotes/Cor\u00e9e\ud83c\uddf0\ud83c\uddf7/\uacf5\ubd80/Cours - Active Korean 4 - 2023-2024'\n# FOLDER = '/path/to/your/markdown/files'\n# PYPANDOC_MARKDOWN = 'markdown_github'\nPYPANDOC_MARKDOWN = 'gfm'\n\nANKI_URL = 'http://localhost:8765/' # url provided by AnkiConnect https://ankiweb.net/shared/info/2055492159\n\n# anki deck name is made by the first H1 of the Markdown\n# anki deck are named : \"Book name - Unit X - unit title\"\n#\n# ANKI_DECK = 'Active Korean 3 - Unit 1'\n\nANKI_MODEL = \"Korean (2 colonnes foxmask)\" # Cor\u00e9en / Fran\u00e7ais\nANKI_FIELD_COUNT = 2 # number of columns to grab from a markdown table\nANKI_FIELDS = ['Cor\u00e9en', 'Fran\u00e7ais', ] # put the name of the fields you want to use with the \"ANKI_MODEL\"\n\n# ANKI_MODEL = 'Korean (foxmask)' # fields are front/back/romanisation\n# ANKI_FIELD_COUNT = 3 # number of columns to grab from a markdown table\n# ANKI_FIELDS = ['Cor\u00e9en', 'Romanisation', 'Fran\u00e7ais']\n\nDATASOURCE = 'MdFile' # MdFile\n```\n\n\n\n## :dvd: DataSource\n\n### Markdown files\n\nThe name of the file should have to be that way:\n\n`foobar - xxx - yyy.md`\n\nfor example\n\n`Kimchi! 01 - insa - \uc778\uc0ac.md`\n\nBaeuda will create note with xxx and yyy as tag in anki.\nIn our example : `insa` and `\uc778\uc0ac`\n\n## Format of notes for Anki\n\nTo process, all the markdown files should have, at least, those content structure:\n\n* h1 with the title of your markdown file\n* h2 with tags name (optional)\n* table with same headers name of the \"fields\" defined in the \"anki type of note\"\n\nLet's see with an example :\n\nIn anki, among the provided types of notes, you can find \"basic\" which content 2 fields \"recto\" and \"verso\"\n\nso in your markdown file you will have to create tables with headers named *recto* and *verso*\n\n\n```\nTitle of the note - Topic - details\n\nRecto | Verso\n-------- | --------\nColor on the sun ? | Yellow\nUniversal reply ? | 42\n```\n\nreal example with three columns\n\n```\nKimchi! Fiche 1 - \uc778\uc0ac - insa - salutations\nCor\u00e9en | Romanisation | Fran\u00e7ais\n------ | ------------ | --------\n\uc548\ub155\ud558\uc138\uc694 | annyeonghaseyo | bonjour\n\n```\n\n\n## Anki desktop\n\nTo add cards to Anki, you need to use an existing model (also known as \"type of notes\")\n\nThere are many models you can use, if none fit your needs, you can create on as I did :\n`tools > type of notes` then `add` button and choose `Duplicate Basic (and reversed card)` then we'll add a third fields `Romanisation` and will change `Front` to `Coreen` and `Back` to `Fran\u00e7ais`\n\nThen add this addon [AnkiConnect](https://foosoft.net/projects/anki-connect/index.html#installation) to allow Anki to allow us to add the notes with the current script.\n\n\n\n## Let's Go\n\nFirst of all, start Anki on your desktop\n\n### simulated process\n\n```bash\npython baeuda/run.py -a report\n```\n\nwill display a table of all the grabbed data to create card\n\n\n### creating cards\n\n```bash\npython baeuda/run.py -a go\n```\n\nduring the execution, you can have a look in anki and see the decks created and receiving cards ;)\n\n\n## From Markdown file to Anki in images\n\n2) baeuda running in the console\n\n![Anki integration](https://raw.githubusercontent.com/foxmask/baeuda/master/anki_integration.png)\n\n3) Anki with the new created decks\n\n![Anki Decks List](https://raw.githubusercontent.com/foxmask/baeuda/master/anki_list_decks.png)\n\n4) the cards of the deck\n\n![Anki The Deck](https://raw.githubusercontent.com/foxmask/baeuda/master/anki_deck.png)\n\n5) one card\n\n![Anki The card](https://raw.githubusercontent.com/foxmask/baeuda/master/anki_card.png)\n\n\n(Image credits to [Emojipedia](https://emojipedia.org/))\n",
"bugtrack_url": null,
"license": "WTFPL",
"summary": "\":mortar_board: Baeuda - \ubc30\uc6b0\ub2e4 - Learn - Create Anki Cards from various datasources\"",
"version": "0.5.0",
"project_urls": {
"Homepage": "https://github.com/foxmask/baeuda"
},
"split_keywords": [
"anki",
"card",
"markdown"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "05f45c471935d9a3b090b8e3797498984663bfa93c4e15fe5b221e95c12e9221",
"md5": "e7476bec22277c38640a0652a0b7d754",
"sha256": "dde6c691cb78bfe70b0eb57b88e2bf891ee6286ef8d485b64ef1d409ff45305f"
},
"downloads": -1,
"filename": "baeuda-0.5.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "e7476bec22277c38640a0652a0b7d754",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 9572,
"upload_time": "2024-08-03T16:39:07",
"upload_time_iso_8601": "2024-08-03T16:39:07.424353Z",
"url": "https://files.pythonhosted.org/packages/05/f4/5c471935d9a3b090b8e3797498984663bfa93c4e15fe5b221e95c12e9221/baeuda-0.5.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "4c90a48051b57210e56c9ec32c3870f8052cf6d24f5760be5d80b73aee8b65d8",
"md5": "367eebdee7eddc76fc7563c8ab32a909",
"sha256": "36ada2c2d6885ddfda347202c344832410a59407e0f103257eccd04fde67b54b"
},
"downloads": -1,
"filename": "baeuda-0.5.0.tar.gz",
"has_sig": false,
"md5_digest": "367eebdee7eddc76fc7563c8ab32a909",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 168737,
"upload_time": "2024-08-03T16:39:09",
"upload_time_iso_8601": "2024-08-03T16:39:09.701552Z",
"url": "https://files.pythonhosted.org/packages/4c/90/a48051b57210e56c9ec32c3870f8052cf6d24f5760be5d80b73aee8b65d8/baeuda-0.5.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-08-03 16:39:09",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "foxmask",
"github_project": "baeuda",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"requirements": [],
"tox": true,
"lcname": "baeuda"
}