Giter Site home page Giter Site logo

keep2todoist's People

Contributors

dependabot[bot] avatar flecmart avatar jordandrako avatar sekrause 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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

keep2todoist's Issues

Adding more automation features

Hi @flecmart,

Thank you for building this tool, this is really useful!

I'm also using Alexa (in parallel to the Google Asisstant) to create tasks in Todoist, however the Alexa integration creates the tasks in a separate projects in Todoist which is really annoying. So I've created a little tool that can move and update tasks based on a few simple rules: https://github.com/ChristianKuehnel/todoistautomation

This solves my use case for Alexa, but can but used to modify any tasks that match a filter query automatically.

The idea is based on what you're doing with keep2todoist and the architecture is quite similar. Do you think it would make sense to merge both tools?

Best,
Christian

gkeepapi error

Hi, I had to change my Google app password (not sure when it last worked), updated my docker image and now I am seeng the below error:

`[khaberz@denode ~]$ sudo docker run -v /home/khaberz/config.yaml:/app/config.yaml --restart always ghcr.io/flecmart/keep2todoist:latest
2023-12-12 16:49:29 configManager-INFO: validating configuration with schema 'config.schema.yaml'
2023-12-12 16:49:29 configManager-INFO: schema validation passed ๐Ÿ‘
2023-12-12 16:49:29 configManager-INFO: configuration validation passed ๐Ÿ‘
2023-12-12 16:49:29 configManager-INFO: updated config: config.yaml
Traceback (most recent call last):
File "/venv/lib/python3.11/site-packages/gkeepapi/node.py", line 214, in load
self._load(raw)
File "/venv/lib/python3.11/site-packages/gkeepapi/node.py", line 291, in _load
self._title = raw['webLink']['title']
~~~~~~~~~~~~~~^^^^^^^^^
KeyError: 'title'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/app/app.py", line 169, in
keep.login(configManager.config['google_username'], configManager.config['google_password'], device_id='3ee9002270d00157')
File "/venv/lib/python3.11/site-packages/gkeepapi/init.py", line 699, in login
self.load(auth, state, sync)
File "/venv/lib/python3.11/site-packages/gkeepapi/init.py", line 749, in load
self.sync(True)
File "/venv/lib/python3.11/site-packages/gkeepapi/init.py", line 1024, in sync
self._sync_notes(resync)
File "/venv/lib/python3.11/site-packages/gkeepapi/init.py", line 1074, in _sync_notes
self._parseNodes(changes["nodes"])
File "/venv/lib/python3.11/site-packages/gkeepapi/init.py", line 1110, in _parseNodes
node = _node.from_json(raw_node)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/venv/lib/python3.11/site-packages/gkeepapi/node.py", line 1930, in from_json
node.load(raw)
File "/venv/lib/python3.11/site-packages/gkeepapi/node.py", line 214, in load
self._load(raw)
File "/venv/lib/python3.11/site-packages/gkeepapi/node.py", line 1191, in _load
super(TopLevelNode, self)._load(raw)
File "/venv/lib/python3.11/site-packages/gkeepapi/node.py", line 1046, in _load
self.annotations.load(raw['annotationsGroup'])
File "/venv/lib/python3.11/site-packages/gkeepapi/node.py", line 214, in load
self._load(raw)
File "/venv/lib/python3.11/site-packages/gkeepapi/node.py", line 524, in _load
annotation = self.from_json(raw_annotation)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/venv/lib/python3.11/site-packages/gkeepapi/node.py", line 505, in from_json
annotation.load(raw)
File "/venv/lib/python3.11/site-packages/gkeepapi/node.py", line 214, in load
self._load(raw)
File "/venv/lib/python3.11/site-packages/gkeepapi/node.py", line 450, in _load
self._entries[key] = NodeAnnotations.from_json({key: entry})
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/venv/lib/python3.11/site-packages/gkeepapi/node.py", line 505, in from_json
annotation.load(raw)
File "/venv/lib/python3.11/site-packages/gkeepapi/node.py", line 216, in load
raise_from(exception.ParseException('Parse error in %s' % (type(self)), raw), e)
File "/venv/lib/python3.11/site-packages/future/utils/init.py", line 406, in raise_from
exec(execstr, myglobals, mylocals)
File "", line 1, in
gkeepapi.exception.ParseException: Parse error in <class 'gkeepapi.node.WebLink'>`

Problem running in a Virtual Environment- "No such file or directory: 'config.schema.yaml'

First off, two things: First, THANK YOU for this script. Second, I'm technically-savvy but a beginner with python and coding in general.

My issue: In an effort to eventually run this script as a Windows Service, I'm first trying to get it to run in a Virtual Environment. I've set one up and activated it but I get this error message when I try to launch the app.py script:

(k2tl) C:\pyvirtuals\k2tl\Scripts>python c:\pyapps\k2tl\app\app.py
Traceback (most recent call last):
File "c:\pyapps\k2tl\app\app.py", line 153, in
configManager = ConfigManager('config.schema.yaml', 'config.yaml')
File "c:\pyapps\k2tl\app\configManager.py", line 18, in init
self.schema = yamale.make_schema(path_to_schema)
File "C:\pyvirtuals\k2tl\lib\site-packages\yamale\yamale.py", line 10, in make_schema
raw_schemas = readers.parse_yaml(path, parser, content=content)
File "C:\pyvirtuals\k2tl\lib\site-packages\yamale\readers\yaml_reader.py", line 34, in parse_yaml
with open(path) as f:
FileNotFoundError: [Errno 2] No such file or directory: 'config.schema.yaml'

This script DOES work perfectly when manually run from outside the VE, I just haven't been able to get it running as a Service. Although I've followed instructions to the letter in setting up a VE for pythons scripts, I also understand that this may have nothing to do with your code, but I wanted to mention it in case you could see anything obvious.

Thanks for your time!

gkeepapi.exception.LoginException: ('BadAuthentication', None)

I love Keep2Todoist! I've been using it for almost a year without any issues.
Since last week, without performing any software updates, I'm getting the following error:

python3 app.py
2023-09-19 22:57:04 configManager-INFO: validating configuration with schema 'config.schema.yaml'
2023-09-19 22:57:04 configManager-INFO: schema validation passed ๐Ÿ‘
2023-09-19 22:57:04 configManager-INFO: configuration validation passed ๐Ÿ‘
2023-09-19 22:57:04 configManager-INFO: updated config: config.yaml
Traceback (most recent call last):
  File "/config/notebooks/keep2todoist/app/app.py", line 169, in <module>
    keep.login(configManager.config['google_username'], configManager.config['google_password'], device_id='3ee9002270d00157')
  File "/usr/local/lib/python3.11/dist-packages/gkeepapi/__init__.py", line 695, in login
    ret = auth.login(username, password, device_id)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/dist-packages/gkeepapi/__init__.py", line 59, in login
    raise exception.LoginException(
gkeepapi.exception.LoginException: ('BadAuthentication', None)

I tried re-installing the packages, pulling a new version from Git, rebuilding Python, updating Python, restarting Jupyter, rebooting HomeAssistant (which runs Jupyter), changing the GKeepApi version to 0.13.6, creating a new Google App password, but unfortunately nothing works. Even putting a false password in config.yaml results in the same error.

I have no idea what to try next.

Can anybody be of any help?

License

What an eloquent approach! Please add a license file to facilitate reuse. I'd love to borrow the concept and point it at Trello.

[Todo] Unit Tests for configManager

I really want the config to be validated so that users cannot make any false configurations that might lead to failures during the ongoing sync process. The ConfigManager class should update and validate the config.

To make sure this works it would be nice to have some unit tests, that validate different example configs to make sure the validation works as intended.

Thanks

Thanks, this was really useful. I had to adapt it so a 'OK Google, add a note to buy milk' was pulled as a note (rather than a list) and put in todoist as 'buy milk today', I also changed the keep note's title to 'Already synced' and appended a date to the text and then archived it.
I don't use 'keep' for anything else so it works well in pulling over all single notes, but I'd ideally I'd like 'OK Google add a note' to make a distinction (set a title or label) so they are easier to find for someone who uses Keep for other reasons.
Your way of using items would have been good except 'OK Google, add a note' doesn't seem to itemize Keep notes...

Adding Keep tasks NOT in lists to Todoist?

I apologize if there's a better way to contact you than creating an Issue. First off, thank you yet again for this script. We were talking last month or so about my getting to run as a service on Windows and I've gotten two instances of it running beautifully.

So, I've noticed that Google Assistant has a hard time parsing many of my "add X to my Y list" commands as requests to add X to a List, especially when X includes prepositions. "Hey Google, make a note, Z" seems to be much more reliable but as you know that command can only add Z as a Note in Keep, not as an item on a List.

Would it be easily possible to add a feature to Keep2todoist to send all orphan Keep Notes (notes not part of Lists) to Todoist, as well as items on Lists?

BadAuthentication

I don't exactly know when it stopped working - there was a Debian Upgrade in that time which is a possible reason. I do get the following error now, which I can't figure out. Any Help is much appreciated. And thank you for this immensely helpful tool!

`
2023-06-15 14:27:37 configManager-INFO: validating configuration with schema './config.schema.yaml'

2023-06-15 14:27:37 configManager-INFO: schema validation passed ๐Ÿ‘

2023-06-15 14:27:37 configManager-INFO: configuration validation passed ๐Ÿ‘

2023-06-15 14:27:37 configManager-INFO: updated config: config.yaml

Traceback (most recent call last):
File "/home/khaberz/keep2todoist-main/app/app.py", line 152, in
keep.login(configManager.config['google_username'], configManager.config['google_password'], device_id='3ee9002270d00157')
File "/home/khaberz/keep2todoist-main/venv/lib/python3.11/site-packages/gkeepapi/init.py", line 697, in login
ret = auth.login(email, password, device_id)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/khaberz/keep2todoist-main/venv/lib/python3.11/site-packages/gkeepapi/init.py", line 62, in login
raise exception.LoginException(res.get("Error"), res.get("ErrorDetail"))
gkeepapi.exception.LoginException: ('BadAuthentication', None)`

Keep notes not deleting.

My notes on the Keep side are not deleting after being moved over to Todoist.

This means they are building up on my Todoist side with duplicates.

Suddenly, Errors!

Suddenly, Errors!

I've been using this for a while without problems and I just noticed this morning that (A) it wasn't working (items sitting in my Keep List) and (B) i got logged out of my Google Account on all of my Android phones.

Checking the server, the application was in a tight crash loop with verbose output.

I cycled my Google App Password and my Todoist API key, but trying to start it again yielded similar looking errors, and trying again also logged out my Google Account on all my Android phones again.

I also blindly did a git fetch && git pull to latest master, I was somewhere back in September. Didn't appear to change anything.

CLICK TO EXPAND ERROR LOG
keep2todoist  | requests.exceptions.HTTPError: 410 Client Error: Gone for url: https://api.todoist.com/rest/v1/tasks
keep2todoist exited with code 1
keep2todoist  | INFO:root:Loading configuration...
keep2todoist  | INFO:root:Start scheduler...
keep2todoist  | INFO:root:Transfering Tasks list from keep to todoist...
keep2todoist  | INFO:root:Transfering Shopping list from keep to todoist...
keep2todoist  | Traceback (most recent call last):
keep2todoist  |   File "/app/./app.py", line 63, in <module>
keep2todoist  |     schedule.run_all()
keep2todoist  |   File "/usr/local/lib/python3.9/site-packages/schedule/__init__.py", line 787, in run_all
keep2todoist  |     default_scheduler.run_all(delay_seconds=delay_seconds)
keep2todoist  |   File "/usr/local/lib/python3.9/site-packages/schedule/__init__.py", line 118, in run_all
keep2todoist  |     self._run_job(job)
keep2todoist  |   File "/usr/local/lib/python3.9/site-packages/schedule/__init__.py", line 172, in _run_job
keep2todoist  |     ret = job.run()
keep2todoist  |   File "/usr/local/lib/python3.9/site-packages/schedule/__init__.py", line 661, in run
keep2todoist  |     ret = self.job_func()
keep2todoist  |   File "/app/./app.py", line 46, in update
keep2todoist  |     transfer_list(keep_list_name, parse_key(keep_list, 'todoist_project'), parse_key(keep_list, 'due_str_en'))
keep2todoist  |   File "/app/./app.py", line 36, in transfer_list
keep2todoist  |     todoist_api.add_task(content=item.text, due_string=due, due_lang='en')
keep2todoist  |   File "/usr/local/lib/python3.9/site-packages/todoist_api_python/api.py", line 60, in add_task
keep2todoist  |     task = post(self._session, endpoint, self._token, data=data)
keep2todoist  |   File "/usr/local/lib/python3.9/site-packages/todoist_api_python/http_requests.py", line 45, in post
keep2todoist  |     response.raise_for_status()
keep2todoist  |   File "/usr/local/lib/python3.9/site-packages/requests/models.py", line 1021, in raise_for_status
keep2todoist  |     raise HTTPError(http_error_msg, response=self)
keep2todoist  | requests.exceptions.HTTPError: 410 Client Error: Gone for url: https://api.todoist.com/rest/v1/tasks
keep2todoist exited with code 1
keep2todoist  | INFO:root:Loading configuration...
keep2todoist  | INFO:root:Start scheduler...
keep2todoist  | INFO:root:Transfering Tasks list from keep to todoist...
keep2todoist  | INFO:root:Transfering Shopping list from keep to todoist...
keep2todoist  | Traceback (most recent call last):
keep2todoist  |   File "/app/./app.py", line 63, in <module>
keep2todoist  |     schedule.run_all()
keep2todoist  |   File "/usr/local/lib/python3.9/site-packages/schedule/__init__.py", line 787, in run_all
keep2todoist  |     default_scheduler.run_all(delay_seconds=delay_seconds)
keep2todoist  |   File "/usr/local/lib/python3.9/site-packages/schedule/__init__.py", line 118, in run_all
keep2todoist  |     self._run_job(job)
keep2todoist  |   File "/usr/local/lib/python3.9/site-packages/schedule/__init__.py", line 172, in _run_job
keep2todoist  |     ret = job.run()
keep2todoist  |   File "/usr/local/lib/python3.9/site-packages/schedule/__init__.py", line 661, in run
keep2todoist  |     ret = self.job_func()
keep2todoist  |   File "/app/./app.py", line 46, in update
keep2todoist  |     transfer_list(keep_list_name, parse_key(keep_list, 'todoist_project'), parse_key(keep_list, 'due_str_en'))
keep2todoist  |   File "/app/./app.py", line 36, in transfer_list
keep2todoist  |     todoist_api.add_task(content=item.text, due_string=due, due_lang='en')
keep2todoist  |   File "/usr/local/lib/python3.9/site-packages/todoist_api_python/api.py", line 60, in add_task
keep2todoist  |     task = post(self._session, endpoint, self._token, data=data)
keep2todoist  |   File "/usr/local/lib/python3.9/site-packages/todoist_api_python/http_requests.py", line 45, in post
keep2todoist  |     response.raise_for_status()
keep2todoist  |   File "/usr/local/lib/python3.9/site-packages/requests/models.py", line 1021, in raise_for_status
keep2todoist  |     raise HTTPError(http_error_msg, response=self)
keep2todoist  | requests.exceptions.HTTPError: 410 Client Error: Gone for url: https://api.todoist.com/rest/v1/tasks
keep2todoist exited with code 1

Feature Request: Add Labels

Feature Request: Add Labels

Like, similarly to the due date, add another key to the yaml per list, to add a Label.

Help with YAML Formatting?

Hello:

Thanks for this! Looks awesome. But I'm having trouble with the YAML formatting, getting apparent syntax errors.

Can you please help?

I just wanted to map my Google Lists to Todoist Lists as follows:

Task -> Tasks
To-Do -> Tasks
Shopping -> Shopping List

and all due 1 year ago.

update_interval_s: 60
google_username: a
google_password: b
todoist_api_token: c
keep_lists:
  - Todo:
    due_str_en: '1 year ago'
  - 'Shopping'
    todoist_project: 'Shopping List'
  - 'Task'
    todoist_project: 'Tasks'
  - 'To-Do'
    todoist_project: 'Tasks'
keep2todoist  | INFO:root:Loading configuration...
keep2todoist  | ERROR:root:Could not load configuration: while parsing a block collection
keep2todoist  |   in "config.yaml", line 6, column 3
keep2todoist  | expected <block end>, but found '<block mapping start>'
keep2todoist  |   in "config.yaml", line 9, column 5
keep2todoist  | Traceback (most recent call last):
keep2todoist  |   File "/app/./app.py", line 52, in <module>
keep2todoist  |     config = load_configuration()
keep2todoist  |   File "/app/./app.py", line 14, in load_configuration
keep2todoist  |     return config
keep2todoist  | UnboundLocalError: local variable 'config' referenced before assignment
keep2todoist exited with code 1

Google Authentication issues

What currently works is:

urllib3<2
gpsoauth==1.0.2
gkeepapi==0.14.2

on python:3.11-bullseye image with OpenSSL 1.1.1w 11 Sep 2023

As soon as I upgrade gpsoauth or gkeepapi (which uses gpsoauth), I end up with something like this: {"Error": "NeedsBrowser", "Url": "https://accounts.google.com/signin/continue?sarp=1&scc=1&continue=https://accounts.google.com/o/android/auth?hl%3Den_us%26xoauth_display_name%3DAndroid%2BLogin%2BService%26source%3DAndroid%2BLogin&plt=VERY_LONG_TOKEN_REDACTED", "ErrorDetail": "To access your account, you must sign in on the web. Touch Next to start browser sign-in."} - also see simon-weber/gpsoauth#60

As soon as I upgrade the os to OpenSSl 3, I end up with BadAuthentication - also see simon-weber/gpsoauth#48

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.