57 4
Sign in to rate

Media Import

<10kB. Updated 2018-07-14.
The author has shared 2 other item(s).


Import media files as new notes. This add-on will allow you to import media files into your Anki collection and use their file names as a component of the note. You can create cards that might look like this (using apple.jpg): When the add-on is installed, a Media Import... option will be added to the Tools menu. Selecting this menu item will open the Media Import window. From this window, you are able to: - Browse and select which folder to use as the source of media files - Choose which note type to use for the imported notes - Decide what content to put into each of the fields Here is a list of the content available to insert into fields. We will use an example file named apple.jpg. - Media - The media file itself (image or audio will appear on the card) - File Name - The name of the file without the extension (apple) - File Name (full) - The name of the file including the extention (apple.jpg) - Extension - Only the extension of the file (jpg) - Sequence - A number indicating the order in which the file was imported. If 15 files were imported, each file will contain a value starting from 0 to 14. All new notes are added to a deck named MediaImport. This deck is created for you automatically if it doesn't exist. If you would like to report an issue or offer contributions, please see the add-on's github page. Current version: 2.5 Changed in 2.5: - Anki 2.1 support (2.0.x will no longer be supported) - Fixed various cases that could generate empty/incorrect decks - Allow mapping to tags Changes in 2.1: - Fixed bug where no cards are generated if you don't select a note type (and use the default). Changes in 2.1: - Fixed bug where you couldn't use a non-ascii path Changes in 2.0: - Added user interface to allow selection of note type and field mapping Changes in 1.3: - Improved error handling if no cards generated Changes in 1.2: - Fixed several issues with non-English file names on Windows Changes in 1.1: - Fixed unicode conversion error (thanks to commenter below)


As add-ons are programs downloaded from the internet, they are potentially malicious. You should only download add-ons you trust.

Supported Anki versions:

To download this add-on, please copy and paste the following code into Anki 2.1:


If you were linked to this page from the internet, please open Anki on your computer, go to the Tools menu and then Add-ons>Browse & Install to paste in the code.

All Anki 2.1.x Add-Ons


on 1670933012
thank you!it's very useful
on 1665367397
Exactly what I needed, thank you!
on 1661336145
Very useful!!
on 1655017789
Saves a lot of work
on 1653215150
- 今天用 [[Anki制作照片闪卡]] ,完美实现了“猜猜我是谁”的预想,在猜完之后可以显示答案,猜的对不对一目了然。制作Anki闪卡也不需要一张一张笨笨的去做,正如我所想,Anki支持插件,一搜,插件多得不比Obsidian少,多张照片的插入制作闪卡用Media Import插件就可以一键导入了。不过要注意的一点是,要插入的图片文件夹所放的位置路径不要有中文字符,第一次导入显示成功,但是查看的时候发现一张图片也没有。考虑是这个问题,我就把所有要做闪卡的图片拷到**D:\TEMP\PIC**里边,但是文件名依然用包含中文名字的文件名,这次导入成功了,并没有因为文件名中有中文字符出现错误。
- Media Import插件的插件码是1531997860,只要把这串号码填到软件的插件设置里就可以自动下载了,并且实践发现,并不需要科学上网,直接就下载速度很快,这一点很令人兴奋。
on 1651123916
on 1649025661
on 1640797940
Wonderful, so I can create my illustrations and play them on the deck, the study will be more dynamic and better.
on 1638471508
Very helpful for creating decks to learn and remember students’ names. Thanks so much!
on 1636905134
this add-on is criminally underrated. it has literally transformed my entire workflow with anki.
thank you for such an amazing contribution.
add-on developers like this are the true heroes of society.
take care!
on 1636428048
on 1634618131
Thank you so much, this Addon you created very helpful for me.
on 1629957844
Works Great, I just want to ask, I have a folder of images Filename0001 - Filename0600, I want to take 2 a time for Front&Back cards
(since I'm trying to import physical flashcards) is there anything about the code that can be tweaked for that?
on 1628269106
- Functionality works as described without technical difficulty or error
- Useful guide provided in Add-on page, enough to get started
on 1617772216
just fantastic - saves me so much work! thanks
on 1612287275
I used this addon and a python to import more than 300 chemical structures of drugs. it took me 3 hours because I didn't know anything about python. Is there anyway to make this work with genanki?
on 1603329418
Perfect. Saved hours of grunt work. Many thanks!
on 1601327940
good addon to import audiobooks
on 1598628087
Sometimes the file name contains several pieces of information. It would be great to have a possibility to use regular expressions to extract parts of the filename into different fields.
on 1593578979
This add-on is a game changer if you would like to have a batch of images to be imported automatically. Very convenient for importing multiple lecture slides into anki Thank you so much for developing this!
on 1593502710
It worked 😭 Thank u so much
on 1582035513
Worked as expected.
on 1579707336
work fine in the windows version 2.1.13
on 1579554583
Installed with 2.1.13 - Anki would no longer start properly, giving error "Failed to execute script runanki". Tried uninstalling Anki, re-installing 2.1.19. Same error. I assume there is some local add-on file causing the problem - looking now to see where to delete it so I can run Anki again.
on 1575303093
Just fix my problem, awesome!
on 1571367889
thank you guys!
on 1570234477
on 1562662685
Great tool.
on 1561986126
Awsome! Saves lots of work. Thank You for this addon!
on 1559831139
I was using Anki for making gifs of signs from Sign Language, and I had to type out the name of every single gif manually (because the name was being used as the answer for the flashcard). This addon makes this entire process automatic, it's incredible.
on 1557856901
Спасибо! В Anki не работает создание карточек через импорт картинок из папки, картинки в карточках не отображались. С Media Import карточки создаются.
on 1556104993
first when i browsed to select a media folder, it did not show any image files. so i thought it was not working. then after a day tried again, noticed folder not images has to be selected and then everything worked as it should. thank you for this addon.
on 1555210914
Caught exception:
File "/Users/D-BOY/Library/Application Support/Anki2/addons21/1531997860/__init__.py", line 85, in doMediaImport
if not mw.col.addNote(note):
File "anki/collection.py", line 307, in addNote
File "anki/collection.py", line 458, in _newCard
File "anki/cards.py", line 78, in flush
<class 'AssertionError'>:
on 1544328697
This add-on has been key to making it easy to turn Gregg shorthand outlines into Anki notes. I start with the images from the Gregg Anniversary textbook at Angelfishy, then I use a tool I wrote (jeremy-w/ImageSlicer) to carve those up and spit them out as images named per the outline's reading, then I slurp the images in using this add-on. Works a charm!
on 1540483343
on 1535799088
This add-on fulfills my requirements exactly!
on 1531339230
very useful! Thanks a lot for your work!
I'm looking forward to the version for Anki 2.1
on 1522886400
Perfect for what I needed!
on 1521504000
exactly what i needed
on 1505347200
Pretty Well but

I really liked the add-on but I still don't know if I can create more than one deck with different images. Anyone knows how to do it?
on 1503964800
Great idea, however, it doesn't work :(

When I import media and then try to view the flashcard, a bluebox with a question mark in it displays instead of the image. Pretty confident I'm not doing anything wrong, I think it's just a big with the addon.
on 1501372800
on 1492992000
on 1487808000
on 1485043200
Great addition to Anki

Thanks for writing this add-on. It has been very useful for adding lecture slides to my notes.
on 1479772800
Created Duplicates

I love this feature, if it weren't for the fact that it creates duplicates every time! I have two of the same card every time I import and they both get deleted if I try to delete one of them
on 1478995200
on 1476835200
on 1475107200
nice feature, but lacks one point

this is nice, indeed. But it lacks the same point as anki itself for media import. It does not rename the imported files. This might get troublesome, if you have asian (etc) sign inside your filenames, as that might mess up your anki-sync.
on 1461110400
on 1454544000
on 1446768000
on 1444262400
on 1440374400
on 1439596800
on 1430870400
on 1407369600
Awesome App

Very useful and time saving for me. The only Issue I face is that I cannot change the card type after it has been imported. It would be nice if I could change the individual card types according to my needs. Please make it possible. Thanks in advance
on 1405123200
same problem

I have the same problem when selecting the folder with the pictures:

Traceback (most recent call last):
File "C:\Users\manuel\Documents\Anki\addons\Media_Import.py", line 65, in doMediaImport
note['Front'] = exp
File "C:\cygwin\home\dae\win\build\pyi.win32\anki\outPYZ1.pyz/anki.notes", line 101, in __setitem__
File "C:\cygwin\home\dae\win\build\pyi.win32\anki\outPYZ1.pyz/anki.notes", line 95, in _fieldOrd
KeyError: 'Front'

I'm using Windows 7. What is this cygwin by the way. Could I solve the problem by installing it?

Thanks a lot.
on 1403913600
Useful if it worked

I always get this error:

Traceback (most recent call last):
File "C:\Users\user\Documents\Anki\addons\Media_Import.py", line 65, in doMediaImport
note['Front'] = exp
File "C:\cygwin\home\dae\win\build\pyi.win32\anki\outPYZ1.pyz/anki.notes", line 101, in __setitem__
File "C:\cygwin\home\dae\win\build\pyi.win32\anki\outPYZ1.pyz/anki.notes", line 95, in _fieldOrd
KeyError: 'Front'

Btw.: C:\cygwin\home doesn't exist on my computer...
on 1399939200
Problems with character encoding

Thanks for creating this useful addon! I've encountered a bug: It won't work if the filenames contain special characters (like "ó" or "á"), it doesn't import anything. I'm on Windows 7, with the most recent version of Anki (2.0.26)

"UnicodeDecodeError: 'utf8' codec can't decode byte 0xe1 in position 7: invalid continuation byte"

after i've changed all the "special" characters, it worked fine!
on 1397433600