Giter Site home page Giter Site logo

anki-airtable's Introduction

Anki Airtable

Note: This plugin is only compatible with Anki 2.1.

This is an Anki plugin that can synchronize an Airtable to Anki when Anki starts up. At the end of the day, Anki is just a flash-card frontend to a database. Why not use Airtable as that database? Airtable is much nicer to use as a database, and makes the data searchable outside of Anki.

I use this to organize and memorize things like the trees and flowers of Ontario, cheeses from around the world, macronutrients of various foods, how to make cocktails and learning new words.

Let's say you're dying to learn when all produce is in season to impress your friends and own the local farmer's market. While you're at it, why not learn the origin of all these vegetables too? 🍅 🌽 🍆 🍎

Having all that information is great. But you really want to have a full overview of all produce by season, and not just have it in your head. Airtable is fantastic for this!

Okay, so you spent the entire afternoon typing in all the produce that grows near you:

This is awesome. You've created some super complicated views in Airtable where you filter your recipes by seasonality, so it won't show you asparagus recipes in the winter, or butternut squash in the spring. Sick.

But back to learning this by heart. You want this table in your head. Unfortunately, Airtable doesn't have a brain interface and this is likely not happening anytime soon. Your best bet to learn this by heart so you can spot the seasonal restaurants and impress your local chefs are flash cards. Basically, you want to learn this table by heart.

This is where Airtable Anki wins.

Install by importing extension 1573217784:

Then highlight the plugin and click Config, and change the configuration file:

This is very important, please make sure you understand this section.

You will need to manually create the Produce model if it doesn't exist. You will ALSO need to create cards for the model because anki-airtable will NOT import records that don't generate any cards. So: (1) create the model, (2) create cards, (3) restart Anki with this plugin.

Once you've created some cards for the new model, you'll see some brand new cards:

Bugs

There's bound to be many.. this doesn't use any proper Airtable client for Python because dependencies are hard in Anki and I don't know anything about Python. To my knowledge no-one but me is using this. If you use it or have trouble getting it running, let me know in an issue!

License

MIT

anki-airtable's People

Contributors

mkrcah avatar sirupsen avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

anki-airtable's Issues

clarify need to create cards for the model

can you clarify the readme section here

You will need to manually create the Produce model if it doesn't exist. You will ALSO need to create cards for the model because anki-airtable will NOT import records that don't generate any cards. So: (1) create the model, (2) create cards, (3) restart Anki with this plugin.

What does the model involve? Do the fields in the model need to be a subset of the view's columns? or do they merely need to intersect?

what does the cards involve? do i need to make one dummy card or cards for every record I want imported?

New cards incorrectly added to 'Default' deck

Hi there, I am having an issue getting synced cards into the correct deck. No matter how I configure things, new cards get added to the Default deck in Anki.

I am using a new model that has a card layout configured, but has no pre-existing cards created.

I debugged the code which sets the current deck airtableImport, line 157 __init__.py, and everything looks correct, so I'm a little stumped on this one.

I realise this is a side project, so I'm mainly looking for a point in the right direction that might allow me to solve this :)

image

{
    "key": "",
    "media_path": "/Users/your_username/Library/Application Support/Anki2/User 1/collection.media/{}",
    "tables": [
        {
            "airtable_key": "",
            "airtable_table": "Wortschatz",
            "airtable_view": "Grid",
            "anki_deck": "🇩🇪 deutsch::Wortschatz",
            "anki_model": "Wort"
        }
    ]
}```

Awesome idea but I'm stuck with this error

Any help would lead to immediate gratification.

Error
An error occurred. Please start Anki while holding down the shift key, which will temporarily disable the add-ons you have installed.
If the issue only occurs when add-ons are enabled, please use the Tools > Add-ons menu item to disable some add-ons and restart Anki, repeating until you discover the add-on that is causing the problem.
When you've discovered the add-on that is causing the problem, please report the issue on the add-on support site.
Debug info:
Anki 2.1.47 (dc156f34) Python 3.8.6 Qt 5.14.2 PyQt 5.14.2
Platform: Mac 10.15.7
Flags: frz=True ao=True sv=2
Add-ons, last update check: 2021-09-04 00:40:46
Add-ons possibly involved: ⁨Airtable Anki⁩

Caught exception:
Traceback (most recent call last):
File "aqt/progress.py", line 54, in handler
File "aqt/main.py", line 150, in on_window_init
File "aqt/main.py", line 245, in setupProfile
File "aqt/main.py", line 425, in loadProfile
File "aqt/hooks_gen.py", line 2951, in call
File "anki/hooks.py", line 34, in runHook
File "/Users/marcussinclair/Library/Application Support/Anki2/addons21/1573217784/init.py", line 186, in hook
airtableImport(mw.col, table["anki_deck"], table["anki_model"], table["airtable_table"], table["airtable_view"], table["airtable_key"])
File "/Users/marcussinclair/Library/Application Support/Anki2/addons21/1573217784/init.py", line 163, in airtableImport
mw.col.models.add(model)
File "anki/models.py", line 204, in add
File "anki/_backend/generated.py", line 438, in add_notetype_legacy
File "anki/_backend/init.py", line 131, in _run_command
anki.errors.InvalidInput: Invalid input: ⁨1 field required⁩

TypeError: write() argument must be str, not bytes

Hey @sirupsen for taking the time to create this extension. Haven't used Anki or Airtable before so I'm likely missing a step somewhere, do you know what might be causing this issue? Looks like my Anki model/airtable should line up but I"m getting a write error.

Screen Shot 2020-03-22 at 11 31 42 AM

Screen Shot 2020-03-22 at 11 33 01 AM

Screen Shot 2020-03-22 at 11 34 19 AM

Caught exception:
Traceback (most recent call last):
File "aqt/progress.py", line 76, in handler
File "aqt/main.py", line 195, in setupProfile
File "aqt/main.py", line 370, in loadProfile
File "aqt/gui_hooks.py", line 1281, in call
File "anki/hooks.py", line 611, in runHook
File "/Users/andreilyskov/Library/Application Support/Anki2/addons21/1573217784/init.py", line 186, in hook
airtableImport(mw.col, table["anki_deck"], table["anki_model"], table["airtable_table"], table["airtable_view"], table["airtable_key"])
File "/Users/andreilyskov/Library/Application Support/Anki2/addons21/1573217784/init.py", line 175, in airtableImport
airtable.updateModel(model)
File "/Users/andreilyskov/Library/Application Support/Anki2/addons21/1573217784/init.py", line 39, in updateModel
for record in self.getRecords():
File "/Users/andreilyskov/Library/Application Support/Anki2/addons21/1573217784/init.py", line 92, in getRecords
self.records = self.getRecordsWithOffset(None)
File "/Users/andreilyskov/Library/Application Support/Anki2/addons21/1573217784/init.py", line 109, in getRecordsWithOffset
sys.stderr.write(raw_response)
File "aqt/errors.py", line 48, in write
TypeError: write() argument must be str, not bytes

airtable table/view naming requires convention

I have a table that could not be imported when

  1. table name = "functional groups"
  2. view name = "summary"

But once I modify the table name and view names to:

  1. table name = "FG"
  2. view name = "Summary"

The import succeeded. It seems like the import depends on the naming of the table, which is probably not desired behaviour.

Proper anki plugin

Instead of this ghetto cloning, can we make this a proper anki plugin?

Configuration

Instead of configuring with a JSON file, can we create a GUI?

Character encoding crash

This is the first time I've tried using this plugin, so maybe I have something configured wrong...

Anki 2.1.4 Python 3.6.1 Qt 5.9.2 PyQt 5.9
Platform: Mac 10.14.1
Flags: frz=True ao=True sv=1

Caught exception:
File "aqt/progress.py", line 67, in handler
File "aqt/main.py", line 120, in setupProfile
File "aqt/main.py", line 261, in loadProfile
File "anki/hooks.py", line 28, in runHook
File "/Users/ldelara/Library/Application Support/Anki2/addons21/1573217784/init.py", line 178, in hook
airtableImport(mw.col, table["anki_deck"], table["anki_model"], table["airtable_table"], table["airtable_view"], table["airtable_key"])
File "/Users/ldelara/Library/Application Support/Anki2/addons21/1573217784/init.py", line 167, in airtableImport
airtable.updateModel(model)
File "/Users/ldelara/Library/Application Support/Anki2/addons21/1573217784/init.py", line 39, in updateModel
for record in self.getRecords():
File "/Users/ldelara/Library/Application Support/Anki2/addons21/1573217784/init.py", line 92, in getRecords
self.records = self.getRecordsWithOffset(None)
File "/Users/ldelara/Library/Application Support/Anki2/addons21/1573217784/init.py", line 109, in getRecordsWithOffset
sys.stderr.write(raw_response)
File "aqt/errors.py", line 39, in write
<class 'TypeError'>: write() argument must be str, not bytes

Don't use CURL

Right now we shell out to curl to get attachments to not have a dependency on an HTTP client... feels like we could do something simpler.

Sync Anki to Airtable?

This is a great idea. Ideally I'd like to sync Anki to Airtable. Is that possible, or is it just Airtable to Anki?

More thorough step by step guide to set up the extension for noobies

Hi! Sorry I'm new to github so I don't know if this is the right place to request this. While I've been trying to set up the addon for hours I am still unable and keep on getting the error code pasted at the bottom. I'm 99% sure it's something I'm not doing correctly as I'm not terribly tech-savy. Is it possible to make a more thorough step by step guide to setting this up - either written or video. It would mean a ton!

Debug info:
Anki 2.1.13 (3ba55990) Python 3.6.7 Qt 5.12.1 PyQt 5.11.3
Platform: Mac 10.14
Flags: frz=True ao=True sv=1
Add-ons possibly involved: Airtable Anki

Caught exception:
File "aqt/progress.py", line 72, in handler
File "aqt/main.py", line 136, in setupProfile
File "aqt/main.py", line 276, in loadProfile
File "anki/hooks.py", line 29, in runHook
File "/Users/xxx/Library/Application Support/Anki2/addons21/1573217784/init.py", line 186, in hook
airtableImport(mw.col, table["anki_deck"], table["anki_model"], table["airtable_table"], table["airtable_view"], table["airtable_key"])
File "/Users/xxx/Library/Application Support/Anki2/addons21/1573217784/init.py", line 175, in airtableImport
airtable.updateModel(model)
File "/Users/xxx/Library/Application Support/Anki2/addons21/1573217784/init.py", line 39, in updateModel
for record in self.getRecords():
File "/Users/xxx/Library/Application Support/Anki2/addons21/1573217784/init.py", line 92, in getRecords
self.records = self.getRecordsWithOffset(None)
File "/Users/xxx/Library/Application Support/Anki2/addons21/1573217784/init.py", line 109, in getRecordsWithOffset
sys.stderr.write(raw_response)
File "aqt/errors.py", line 41, in write
<class 'TypeError'>: write() argument must be str, not bytes

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.