Title: Read Anki Flashcard Databases
Version: 0.1.0
Author: Christos Longros [aut, cre]
Maintainer: Christos Longros <chris.longros@gmail.com>
Description: Read and analyze Anki flashcard collection databases. Provides functions to access notes, cards, and review logs from Anki's SQLite database with a tidy interface.
License: MIT + file LICENSE
Encoding: UTF-8
RoxygenNote: 7.3.3
Imports: DBI, RSQLite, tibble
URL: https://github.com/chrislongros/ankiR
BugReports: https://github.com/chrislongros/ankiR/issues
NeedsCompilation: no
Packaged: 2026-01-11 10:31:16 UTC; chris
Repository: CRAN
Date/Publication: 2026-01-16 11:00:19 UTC

Get Anki base path

Description

Returns the default Anki2 directory for the current platform.

Usage

anki_base_path()

Value

Character string path to Anki2 directory

Examples

## Not run: 
anki_base_path()

## End(Not run)

Read cards from Anki collection

Description

Read cards from Anki collection

Usage

anki_cards(path = NULL, profile = NULL)

Arguments

path

Path to collection.anki2 (auto-detected if NULL)

profile

Profile name (first profile if NULL)

Value

A tibble of cards

Examples

## Not run: 
anki_cards()

## End(Not run)

Open an Anki collection

Description

Open an Anki collection

Usage

anki_collection(path = NULL, profile = NULL)

Arguments

path

Path to collection.anki2 (auto-detected if NULL)

profile

Profile name (first profile if NULL)

Value

An anki_collection object with methods: notes(), cards(), revlog(), tables(), close()

Examples

## Not run: 
col <- anki_collection()
col$notes()
col$close()

## End(Not run)

Get path to Anki database

Description

Get path to Anki database

Usage

anki_db_path(profile = NULL, base_path = NULL)

Arguments

profile

Profile name (first profile if NULL)

base_path

Path to Anki2 directory (auto-detected if NULL)

Value

Character string path to collection.anki2

Examples

## Not run: 
anki_db_path()

## End(Not run)

Read notes from Anki collection

Description

Read notes from Anki collection

Usage

anki_notes(path = NULL, profile = NULL)

Arguments

path

Path to collection.anki2 (auto-detected if NULL)

profile

Profile name (first profile if NULL)

Value

A tibble of notes

Examples

## Not run: 
anki_notes()

## End(Not run)

List Anki profiles

Description

List Anki profiles

Usage

anki_profiles(base_path = NULL)

Arguments

base_path

Path to Anki2 directory (auto-detected if NULL)

Value

Character vector of profile names

Examples

## Not run: 
anki_profiles()

## End(Not run)

Read review log from Anki collection

Description

Read review log from Anki collection

Usage

anki_revlog(path = NULL, profile = NULL)

Arguments

path

Path to collection.anki2 (auto-detected if NULL)

profile

Profile name (first profile if NULL)

Value

A tibble of review log entries

Examples

## Not run: 
anki_revlog()

## End(Not run)

Convert Anki timestamp to date

Description

Convert Anki timestamp to date

Usage

anki_timestamp_to_date(x)

Arguments

x

Numeric timestamp in milliseconds since epoch

Value

Date object

Examples

anki_timestamp_to_date(1368291917470)

Convert Anki timestamp to datetime

Description

Convert Anki timestamp to datetime

Usage

anki_timestamp_to_datetime(x)

Arguments

x

Numeric timestamp in milliseconds since epoch

Value

POSIXct datetime object

Examples

anki_timestamp_to_datetime(1368291917470)