Skip to content

import apkg anki files#87

Open
FineFindus wants to merge 2 commits into
wbernard:mainfrom
FineFindus:feat/import-ank2-extension
Open

import apkg anki files#87
FineFindus wants to merge 2 commits into
wbernard:mainfrom
FineFindus:feat/import-ank2-extension

Conversation

@FineFindus
Copy link
Copy Markdown

Anki files can be exported as Deck packages .apkg. These contain the anki2 file itself, alongside all the media included in the deck. As they are renamed zip files, we can simply extract the collection.anki2 and import it normally.

Based on #85.

Comment thread src/window.py
filename, file_extension = os.path.splitext(file)
if file_extension == ".db":
self.import_db_file(file)
self.import_db_file(file.get_path())
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I'm a bit confused by this, how does this still work without changing import_db_file itself? 😅

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

It doesn't I must have missed that this is another function :)
Changed in 47f1240, to be the file_path, so it's similar to import_anki2_file, but I can revert it if you prefer.

@bertob
Copy link
Copy Markdown
Collaborator

bertob commented Mar 5, 2025

Could you drop the commits that have been merged/are no longer relevant?

Anki files can be exported as Deck packages`.apkg`. These contain the
anki2 file itself, alongside all the media included in the deck. As
they are renamed zipfiles, we can simply extract the `collection.anki2`
and import it normally.

Ref: https://docs.ankiweb.net/exporting.html#deck-apkg
@FineFindus FineFindus force-pushed the feat/import-ank2-extension branch from 39ad055 to b89428c Compare March 5, 2025 19:03
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.

2 participants