dogsheep / dogsheep/pocket-to-sqlite

Error; Option to limit the number of items?

Open
#14 1 comment 1 reaction 0 assignees View on GitHub
Dominant language
Python
Stars
106
Forks
5
PR merge metrics
No merged PRs in 30d

Description

Hi,

Thanks for the wonderful plug-in. I ran into this error while trying it on my account.

Is it that my account with 12.3k items is too big to fetch with this?

If that's the case, can you add an option to limit the number of items? (i.e. last k recent items)

Thanks again.

(base) ➜ datasettes pocket-to-sqlite fetch pocket.db

[------------------------------------] 0/12317
Traceback (most recent call last):
File "/Users/lifidea/anaconda3/bin/pocket-to-sqlite", line 8, in
sys.exit(cli())
^^^^^
File "/Users/lifidea/anaconda3/lib/python3.11/site-packages/click/core.py", line 1157, in __call__
return self.main(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/lifidea/anaconda3/lib/python3.11/site-packages/click/core.py", line 1078, in main
rv = self.invoke(ctx)
^^^^^^^^^^^^^^^^
File "/Users/lifidea/anaconda3/lib/python3.11/site-packages/click/core.py", line 1688, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/lifidea/anaconda3/lib/python3.11/site-packages/click/core.py", line 1434, in invoke
return ctx.invoke(self.callback, **ctx.params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/lifidea/anaconda3/lib/python3.11/site-packages/click/core.py", line 783, in invoke
return __callback(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/lifidea/anaconda3/lib/python3.11/site-packages/pocket_to_sqlite/cli.py", line 101, in fetch
utils.save_items(bar, db)
File "/Users/lifidea/anaconda3/lib/python3.11/site-packages/pocket_to_sqlite/utils.py", line 9, in save_items
for item in items:
File "/Users/lifidea/anaconda3/lib/python3.11/site-packages/click/_termui_impl.py", line 344, in generator
for rv in self.iter:
File "/Users/lifidea/anaconda3/lib/python3.11/site-packages/pocket_to_sqlite/utils.py", line 119, in __iter__
items = list((page["list"] or {}).values())
~~~~^^^^^^^^
KeyError: 'list'

Contributor guide

No contributing guide indexed for this repository

Research direction

Reproduce the failure with `pocket-to-sqlite fetch pocket.db`, then start at `pocket_to_sqlite/cli.py:101` and follow `utils.py:9` and `utils.py:119`, where the traceback occurs. Determine how the fetch should support selecting a limited number of recent items and how the observed response error should be handled; done means the command works for this account and the limit is honored.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, sqlite
Domain
api, cli
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.