Google Sheets For Languages
Two-way sync between an Anki vocabulary deck and a Google Sheet, designed for language learners using a forward + reverse card pair (e.g. Anki's stock Basic (and reversed card) note type).
- Sheet → Anki: add rows in your sheet → notes appear in Anki on next sync. Edit
word, trans, example, tags and they flow into Anki.
- Anki → Sheet: after each sync, every row gets updated with the current interval, lapses, ease, and suspension state of both cards.
- Smart reverse-card gating: the reverse card (target-language → native) stays auto-suspended until the forward card matures, so you don't waste reps drilling words you barely recognise.
- Multiple tabs supported: one tab per topic (
anki_verbs, anki_phrases, …). Each tab "owns" the notes it created.
- Manual suspension: set
man_fw_sus or man_bw_sus to 1 in the sheet to force-suspend a card.
Works for any language: Greek, Spanish, Japanese, German, etc. The default UI is language-neutral. A power-user toggle (enable_greek_verb_format) adds Greek-specific paradigm-table rendering for |-separated cells.
Install
From AnkiWeb (when published)
In Anki: Tools → Add-ons → Get Add-ons, paste the addon ID.
From source (current path)
git clone https://github.com/YOUR_USERNAME/anki-sheets-for-languages
cd anki-sheets-for-languages
./build.sh # produces ../sheets_for_languages.ankiaddon
Then in Anki: Tools → Add-ons → Install from file… → pick the .ankiaddon.
Setup (one-time)
1. Google Cloud project + Sheets API
- Open https://console.cloud.google.com/projectcreate. Pick any project name (e.g.
anki-sheets). Click Create and wait ~30 seconds for the project to provision. Make sure the new project is selected in the project picker at the top of the page.
- Go to APIs & Services → Library (left sidebar). Search for Google Sheets API. Open it and click Enable. Wait until the page reloads showing "API enabled".
2. Create a service account
- Go to APIs & Services → Credentials. Click + Create credentials → Service account.
- Step 1 — Service account details:
- Service account name: anything memorable, e.g.
anki-sync
- Service account ID auto-fills from the name — leave it
- Description: optional
- Click Create and continue.
- Step 2 — Grant this service account access to project (optional): skip this. The service account doesn't need a project-level role; access to your sheet is granted directly via sharing in step 4. Click Continue.
- Step 3 — Principals with access (optional): skip this too. This is for letting other Google users impersonate the service account, which we don't need. Click Done.
- You're back at the Credentials page. Find the new service account in the Service Accounts section and click its email to open it.
- Copy the email at the top of the detail page (looks like
anki-sync@your-project.iam.gserviceaccount.com). You'll paste it into your sheet in step 4.
3. Generate the JSON key
- Still on the service-account detail page, click the Keys tab.
- Click Add key → Create new key. Select JSON. Click Create.
- A
.json file downloads automatically. You'll feed it into the addon in step 5 — after that the addon stores the credential internally and the original file isn't needed any more.
⚠️ Treat this file like a password until it's loaded into the addon. Anyone with it has access to whatever sheets you share with the service-account email. After step 5 it's safe to delete the downloaded file.
4. Share your sheet with the service account
- Open your Google Sheet in the browser.
- Click Share (top-right).
- Paste the service-account email from step 2.6.
- Set permission to Editor.
- Uncheck "Notify people" (the service account has no inbox; you'll just get a bounce email otherwise).
- Click Share.
Skipping this step is the most common cause of a 403 error on sync.
5. Configure the addon
Tools → Add-ons → Google Sheets For Languages → Config. A dialog with dropdowns appears:
- Spreadsheet URL — paste the full URL of your sheet.
- Service account — click Browse, pick the
.json from step 3. The addon reads the file once and stores the credential in its own config; the source file can be deleted afterwards. The service-account email is shown in the dialog as confirmation.
- Deck — choose from your existing decks. New notes go here.
- Note type — defaults to
Sheets For Languages (created automatically by the addon). You can pick any note type that produces two cards (forward + reverse).
- Word / Trans / Example field — pick the three note-type fields to map to the sheet's
word, trans, example columns. Defaults map to Front / Back / Example.
- Back card delay (days) — reverse card stays suspended until the forward card's interval reaches this many days. Default 10.
- Sheet tab prefix — only sheet tabs starting with this prefix are synced. Default
anki_.
- Enable Greek verb-format transform — leave off unless you want Greek paradigm tables.
6. Sync
Tools → Sync with Google Sheets. A progress bar appears; on success you get a one-line summary.
On the very first sync, if your spreadsheet has no anki_* tab, the addon creates one (anki_default) with the right headers and pulls every existing note from the configured Anki deck into it. From then on you can add rows directly in the sheet, or add more tabs (anki_verbs, anki_phrases, …) for separate topics.
Sheet columns
| Column |
Direction |
Meaning |
note_id |
addon writes |
Anki note ID (leave blank on new rows; the addon fills it in) |
word |
you fill |
target-language term (front of the forward card) |
trans |
you fill |
native-language translation (back of the forward card) |
example |
you fill |
example sentence or extra context |
tags |
both ways |
comma-separated tag list |
man_fw_sus, man_bw_sus |
you fill |
1 to manually suspend the forward / reverse card |
fw_int, bw_int |
addon writes |
current interval in days |
fw_lapses, bw_lapses |
addon writes |
lapse count |
fw_ease, bw_ease |
addon writes |
ease factor (2500 = 250 %) |
fw_is_sus, bw_is_sus |
addon writes |
1 if suspended |
rev_auto_sus |
addon writes |
1 if reverse was auto-suspended by the delay gate |
Troubleshooting
- 403 / Permission denied — you skipped step 2: share the sheet with the service-account email.
- "Sheets API has not been used in project X" — enable the Sheets API (step 1.2).
- "note_id appears in two tabs" — manually delete the duplicate from one of the tabs.
Contributing
Issues and PRs welcome at https://github.com/YOUR_USERNAME/anki-sheets-for-languages.
Rebuilding the vendored lib/
rm -rf lib && mkdir lib
pip install --target=lib --no-binary=:all: --no-deps -r requirements.txt
find lib -name "__pycache__" -type d -exec rm -rf {} +
rm -rf lib/bin lib/*.dist-info
google-auth is pinned <2.20 because newer versions unconditionally import the platform-specific cryptography library. The older line keeps a pure-Python RSA fallback via the rsa package — that's what lets us ship a single cross-platform addon.
License
MIT — see LICENSE.