sirupsen / anki-airtable Goto Github PK
View Code? Open in Web Editor NEWSync Anki with Airtable!
Sync Anki with Airtable!
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.
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
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.
Right now you have to create them... which sucks.
I have a table that could not be imported when
But once I modify the table name and view names to:
The import succeeded. It seems like the import depends on the naming of the table, which is probably not desired behaviour.
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?
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 :)
{
"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"
}
]
}```
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
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
Setting up "aqt" and associated packages has been a challenge. Can you write something up about that?
Also, having a requirements.txt file would be useful.
Instead of configuring with a JSON file, can we create a GUI?
Instead of this ghetto cloning, can we make this a proper anki plugin?
This is a great idea. Ideally I'd like to sync Anki to Airtable. Is that possible, or is it just Airtable to Anki?
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
Traceback (most recent call last):
File "C:\Users\mathe\AppData\Roaming\Anki2\addons21\428974728_init_.py", line 195, in getRecords
r.raise_for_status()
File "lib\site-packages\requests\models.py", line 940, in raise_for_status
requests.exceptions.HTTPError: 422 Client Error: Unprocessable Entity for url: https://api.airtable.com/v0/app3aCihEur7qKcA4/Table%201?view=Grid+view+%283%29
Hi
In https://github.com/sirupsen/anki-airtable you have an URL to https://airtable.com/shrvVrHDN6idKdAZN
The page I obtain is: «The private share link you tried to reach is not available.
The owner of this base may have unshared or deleted it. Please contact them if you need access.»
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.