lazeroffmichael / ticktick-py

Unofficial TickTick API
https://lazeroffmichael.github.io/ticktick-py/
MIT License
216 stars 31 forks source link

Need of sync call in CLI application #11

Open GirishPatel opened 3 years ago

GirishPatel commented 3 years ago

I am trying to create CLI application using this library. Since CLI applications are adhoc and short lived, there is not point in maintaining session and doing sync call. Hence no requirement of passing username/password and initiating session.

So we can support oauth_only flag in TickTickClient and skip sync for all API calls.

@lazeroffmichael suggestions ?

lazeroffmichael commented 1 year ago

Hey @GirishPatel - sorry for the super late response, but you are perfectly correct. The issue is that not all functionality works directly through OAuth - only tasks as far as I am aware. I would need to investigate further to see if other endpoints will work using only OAuth to consider removing the logging in/sessionizing entirely. An issue with the library right now is that it's very heavy in that I rely on the sync call to perform checks to catch errors earlier for users. I am heavily considering removing the automatic sync call needed for these checks in favor of just clearer documentation on known behaviors. In an ideal world, TickTick would implement and provide a more robust OpenAPI, but sadly it is not the case :(