Skip to content

Add import functionality#3

Open
hult wants to merge 6 commits intorkachowski:masterfrom
hult:master
Open

Add import functionality#3
hult wants to merge 6 commits intorkachowski:masterfrom
hult:master

Conversation

@hult
Copy link

@hult hult commented Mar 23, 2017

Adds a function Anki::apkg_importer.import that imports decks from an apkg file. Added instructions to the readme file.

end

def self.apkg_importer
# TODO: This is daft

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:)

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

agreed. i'll probably massage the api to be something like Anki::export and Anki::import

@leogiertz
Copy link

@rkachowski would be fantastic if you could take a look at this. :)

@rkachowski
Copy link
Owner

Hmm, my email notifications seem to be screwed up. Thanks for mentioning me - I'll look at this asap

@leogiertz
Copy link

@rkachowski Do you have the time to look at this? :)

end

def self.apkg_importer
# TODO: This is daft
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

agreed. i'll probably massage the api to be something like Anki::export and Anki::import

back_text, back_media = self.parse_text(back)

# TODO: Is it one card per card or per note?
# And where should the id come from?
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the anki db schema is a bit funky, but conceptually a card contains references to several notes. afaik as long as they are unique and consistent within a deck, all should be fine. https://github.com/dae/anki/blob/b5a89737913afe04a518cd7741a2c90d5eeb9692/anki/storage.py#L233

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants