Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add import functionality #3

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open

Add import functionality #3

wants to merge 6 commits into from

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.

@@ -5,4 +5,9 @@ module Anki
def self.apkg
APKGExporter
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? :)

@@ -5,4 +5,9 @@ module Anki
def self.apkg
APKGExporter
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