Peters-MacBook-Air:Obsidian_to_Anki-master peter$ python3 obsidian_to_anki.py -f /Volumes/NO\ NAME/Test/Commercial\ art.md
Loading configuration file...
Loaded successfully!
Reading file /Volumes/NO NAME/Test/Commercial art.md into memory...
Traceback (most recent call last):
File "obsidian_to_anki.py", line 576, in <module>
App()
File "obsidian_to_anki.py", line 394, in __init__
self.target_deck = App.DECK_REGEXP.search(self.file).group(0)
AttributeError: 'NoneType' object has no attribute 'group'
Please note the .py needs to be included in the command - it is not in your instructions.
Now, after running the script I looked in Anki and did not find the new card.
Here is the full text of the Obsidian file:
---
Author: Hugh McLeod
Book: , p.
Original number: n47
Site: [Brain Pickings](https://www.brainpickings.org/index.php/2012/02/27/purpose-work-love/)
Transcluded in:
Note creation date: 2014-08-25
---
Tags: #creativity #wealth #commercialisation
---
> Art suffers the moment other people start paying for it.
*<!--PB:-->Lewis Hyde [[Creative labour|agrees]]*.
The reason is that when you start doing it to make money, you’re starting to kill yourself artistically. - [source](https://www.brainpickings.org/2014/05/13/pete-seeger-paul-zollo-songwriters-on-songwriting/)
<br>
<br>
<br>
<br>
START
Basic (and reversed)
Commercial art: when does it suffer?
Back: when people start paying for it
END
<br>
*Footnotes*
@Klaas I see the problem. You are describing the note type as ‘Basic (and reversed)’ - Anki actually stores it as ‘Basic (and reversed card)’.
If you’d like to refer to it as ‘Basic (and reversed)’, here’s what I suggest:
Try running python3 obsidian_to_anki.py -c - this should open up the config file for editing. If that doesn’t work, you’ll have to navigate to the config file yourself.
Once you’ve got the config file open, navigate to the section that says [‘Note Substitutions’]. It should be at the end of the file
@Pseudonium: yes it works now. Many thanks for a useful script.
1 piece of advice, if I may:
since Anki uses the Basic (and reversed card) term, I think you should use that terminology too, as you have done in the config.ini file.
Therefore, you should amend the “Config” section in your README.md file, because it will cause confusion, as it did with me when I followed your README file.
I actually do mean file. You can specify global tags on a file-level, but not on a directory-level. So in the file you have notes in, you add the GLOBAL TAGS line.
@Pseudonium: OK. So I can add that to any 1 of those .md files and the tags will be added to every card I create from that vault? I only need to add it to just 1 .md file in the vault?
What do you mean by “file”?
Or perhaps I should ask what do you mean by notes? To me notes means .md files, and those files/notes are sitting in a folder called the vault.
That is not what you means, so you have lost me, completely !
@Klaas Ah I can see how that would be confusing. So for me, notes =/=.md file - notes are the actual text/images inside a file.
By ‘file’, I mean actual .md file.
So, as an example:
GLOBAL TAGS
Literature Philosophy
START
Basic
This is a test
Back: Test successful!
Tags: Test
END
If you pasted that into a file, and saved it, and then ran the script over it, it would add a single ‘Basic’ note into Anki, with the tags “Literature”, “Philosophy” and “Test”, even though you only specified the “Test” tag inside the note itself.
Sorry, it’s probably extra confusing because Anki gives almost a third meaning to ‘note’, since cards are generated from notes!
So, to summarise:
For you, a ‘note’ is a .md file
For me, a ‘note’ is a piece of text inside a file about a topic (which might be formatted appropriately for Anki, or outside separately)
For Anki, a ‘note’ is something from which cards are generated, according to your template for that note type