Version at: 20/12/2020, 03:31 vs. version at: 20/12/2020, 03:32
11** How to make your own Anki deck that includes all the sentences you want from Tatoeba with audio **
22
33Note: If you don't know what Anki is, read the [Wikipedia article on Anki]( https://en.wikipedia.org/wiki/Anki_(software\)).
44
55I decided to make a program to make an Anki deck from sentences on Tatoeba, with audio. It's not perfect but I tried it and found quite useful for me. I tested it under Linux Ubuntu. It should work under any other common operating system since it's written in Python 3. You can import as many sentences as you want from any list or favorite page. I tested it with [list 4022](https://tatoeba.org/eng/sentences_lists/show/4022) and [my favorites](https://tatoeba.org/eng/favorites/of_user/odexed).
66
77** Short instructions for Windows users **
88
99* You must have Anki installed on your computer. If not, you can get it from the [Anki site]( http://ankisrs.net/). It's easy to install.
1010
1111* If you don't have Python or it's not version 3+, you should [install it][1].
1212
1313* Put into any folder and open Tatoeba_anki.py with a text editor. (Note that Python treats tabs and spaces differently, so you may want to use a text editor that displays them differently, and enable this feature. Avoid using any text editor, such as Notepad, that inserts a byte-order mark at the beginning of the file. [Notepad++](https://notepad-plus-plus.org/) works well, and is free.) All you need to do is to edit at least 4 variables on the top of the file. For example, you want to make Anki cards from the quotes of Barack Obama with audio and translations into your language. You set the first variable, UrlListOfSentences, as follows:
1414
1515
1616 `UrlListOfSentences = 'https://tatoeba.org/eng/sentences_lists/show/4022/none/'`
1717
1818The link must be to a list of sentences, a list of favorites, or a list of a user's sentences. The program does not work properly with advanced search results.
1919
2020If, for instance, your native language is French and you are only interested in English sentences from this list, set srclang as follows:
2121
2222 srclang = ["eng"]
2323
2424It should be in square brackets because you can set several languages within a list:
2525
2626 srclang = ["eng","spa"]
2727
2828Add the following:
2929
3030 set audio3letterslangcodes = ["eng"]
3131
3232This will be the same as srclang, use should use 3 letter language codes, as on Tatoeba.
3333
3434Finally, add this:
3535
3636 targetlang = "fra"
3737
3838Use only one target language per deck.
3939
4040* Save the file and close it. Run Tatoeba_anki.py and wait for a while.
4141If the program is working correctly, you should see a black console window that will close in a while. After this, you will see a new folder 'foranki' in the same directory. This folder contains the csv file and media files with audio.
4242
4343* Optionally, add this:
4444
4545 copymediafilestoankifolder = True
4646
4747and set the `ankimediafolder` variable to the desired value. If you don't do this, you will have to manually copy all mp3 files into the Anki media folder, which is called `collection.media` and can usually be found in your Documents folder.
4848
4949* Open Anki and import new deck of cards. Choose 'exampledeck.csv' as a source.
5050
5151
5252You can get the source code from [Tatoeba-anki-deckgeneration](https://github.com/explanacion/Tatoeba-anki-deckgeneration)
5353and edit it however you like. It should work with most Python 3 varieties.
5454
5555Once you have imported the deck, you can export it as a pkg file and use it on your cell phone. I have tested it.
5656
5757 [1]: https://www.python.org/downloads/
5858
diff view generated by jsdifflib

Version at: 20/12/2020, 03:31

** How to make your own Anki deck that includes all the sentences you want from Tatoeba with audio **

Note: If you don't know what Anki is, read the [Wikipedia article on Anki]( https://en.wikipedia.org/wiki/Anki_(software\)).

I decided to make a program to make an Anki deck from sentences on Tatoeba, with audio. It's not perfect but I tried it and found quite useful for me. I tested it under Linux Ubuntu. It should work under any other common operating system since it's written in Python 3. You can import as many sentences as you want from any list or favorite page. I tested it with [list 4022](https://tatoeba.org/eng/sentences_lists/show/4022) and [my favorites](https://tatoeba.org/eng/favorites/of_user/odexed).

** Short instructions for Windows users **

* You must have Anki installed on your computer. If not, you can get it from the [Anki site]( http://ankisrs.net/). It's easy to install.

* If you don't have Python or it's not version 3+, you should [install it][1]. 

* Put into any folder and open Tatoeba_anki.py with a text editor. (Note that Python treats tabs and spaces differently, so you may want to use a text editor that displays them differently, and enable this feature. Avoid using any text editor, such as Notepad, that inserts a byte-order mark at the beginning of the file. [Notepad++](https://notepad-plus-plus.org/) works well, and is free.) All you need to do is to edit at least 4 variables on the top of the file. For example, you want to make Anki cards from the quotes of Barack Obama with audio and translations into your language. You set the first variable, UrlListOfSentences, as follows:


    `UrlListOfSentences = 'https://tatoeba.org/eng/sentences_lists/show/4022/none/'`

The link must be to a list of sentences, a list of favorites, or a list of a user's sentences. The program does not work properly with advanced search results.

If, for instance, your native language is French and you are only interested in English sentences from this list, set srclang as follows:

    srclang = ["eng"] 

It should be in square brackets because you can set several languages within a list:

    srclang = ["eng","spa"]

Add the following:

    set audio3letterslangcodes = ["eng"] 
    
This will be the same as srclang, use should use 3 letter language codes, as on Tatoeba.

Finally, add this:

    targetlang = "fra" 
    
Use only one target language per deck.

* Save the file and close it. Run Tatoeba_anki.py and wait for a while.
If the program is working correctly, you should see a black console window that will close in a while. After this, you will see a new folder 'foranki' in the same directory. This folder contains the csv file and media files with audio.

* Optionally, add this:

    copymediafilestoankifolder = True
    
and set the `ankimediafolder` variable to the desired value. If you don't do this, you will have to manually copy all mp3 files into the Anki media folder, which is called `collection.media` and can usually be found in your Documents folder.

* Open Anki and import new deck of cards. Choose 'exampledeck.csv' as a source.


You can get the source code from [Tatoeba-anki-deckgeneration](https://github.com/explanacion/Tatoeba-anki-deckgeneration)
and edit it however you like. It should work with most Python 3 varieties.

Once you have imported the deck, you can export it as a pkg file and use it on your cell phone. I have tested it.

  [1]: https://www.python.org/downloads/

version at: 20/12/2020, 03:32

** How to make your own Anki deck that includes all the sentences you want from Tatoeba with audio **

Note: If you don't know what Anki is, read the [Wikipedia article on Anki]( https://en.wikipedia.org/wiki/Anki_(software\)).

I decided to make a program to make an Anki deck from sentences on Tatoeba, with audio. It's not perfect but I tried it and found quite useful for me. I tested it under Linux Ubuntu. It should work under any other common operating system since it's written in Python 3. You can import as many sentences as you want from any list or favorite page. I tested it with [list 4022](https://tatoeba.org/eng/sentences_lists/show/4022) and [my favorites](https://tatoeba.org/eng/favorites/of_user/odexed).

** Short instructions for Windows users **

* You must have Anki installed on your computer. If not, you can get it from the [Anki site]( http://ankisrs.net/). It's easy to install.

* If you don't have Python or it's not version 3+, you should [install it][1]. 

* Put into any folder and open Tatoeba_anki.py with a text editor. (Note that Python treats tabs and spaces differently, so you may want to use a text editor that displays them differently, and enable this feature. Avoid using any text editor, such as Notepad, that inserts a byte-order mark at the beginning of the file. [Notepad++](https://notepad-plus-plus.org/) works well, and is free.) All you need to do is to edit at least 4 variables on the top of the file. For example, you want to make Anki cards from the quotes of Barack Obama with audio and translations into your language. You set the first variable, UrlListOfSentences, as follows:


    `UrlListOfSentences = 'https://tatoeba.org/eng/sentences_lists/show/4022/none/'`

The link must be to a list of sentences, a list of favorites, or a list of a user's sentences. The program does not work properly with advanced search results.

If, for instance, your native language is French and you are only interested in English sentences from this list, set srclang as follows:

    srclang = ["eng"] 

It should be in square brackets because you can set several languages within a list:

    srclang = ["eng","spa"]

Add the following:

    set audio3letterslangcodes = ["eng"] 
    
This will be the same as srclang, use should use 3 letter language codes, as on Tatoeba.

Finally, add this:

    targetlang = "fra" 
    
Use only one target language per deck.

* Save the file and close it. Run Tatoeba_anki.py and wait for a while.
If the program is working correctly, you should see a black console window that will close in a while. After this, you will see a new folder 'foranki' in the same directory. This folder contains the csv file and media files with audio.

* Optionally, add this:

    copymediafilestoankifolder = True
    
and set the `ankimediafolder` variable to the desired value. If you don't do this, you will have to manually copy all mp3 files into the Anki media folder, which is called `collection.media` and can usually be found in your Documents folder.

* Open Anki and import new deck of cards. Choose 'exampledeck.csv' as a source.


You can get the source code from [Tatoeba-anki-deckgeneration](https://github.com/explanacion/Tatoeba-anki-deckgeneration)
and edit it however you like. It should work with most Python 3 varieties.

Once you have imported the deck, you can export it as a pkg file and use it on your cell phone. I have tested it.

  [1]: https://www.python.org/downloads/

Note

The lines in green are the lines that have been added in the new version. The lines in red are those that have been removed.