lazeroffmichael / ticktick-py

Unofficial TickTick API

Home Page:https://lazeroffmichael.github.io/ticktick-py/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Make password/username optional

C0rn3j opened this issue · comments

commented

It is not required for pure OpenAPI access, client ID and secret should be enough.

This is loosely related to #38.

I have thought of this as well, but came to the conclusion that the current way of requiring the OAuth method is what might conform most to the intentions on the TickTick side.

Don't get me wrong, removing this as a necessity is rather easy and would probably simplify the library quite a bit. I have even done it for some of my projects, using a stripped down version of the library! And that's my point, if someone really doesn't like this requirement, they can probably remove it themselves without much of a hassle.

My stance on this is very connected to the #38 discussion! Part of the reason I started that was to see if other contributors had different ideas about what we should do in regard to the OpenAPI. Everyone who has worked with it knows that it's practically a joke when it comes to useability, but that's exactly why we should use it as much as possible: To show TickTick that there are a lot of things that just simply can't be done with what they offer us.

However, it might not be too bad having a "OAuth-free" mode that developers can enable... Implementing this would be fairly easy, but some of the basic things that are currently done using the OpenAPI would have to be rewritten (they would have to offer the alternative), which isn't a ton of work but work nonetheless.

  • btw04
commented

I have thought of this as well, but came to the conclusion that the current way of requiring the OAuth method is what might conform most to the intentions on the TickTick side.

I opened this issue to optionally ditch username and password, not the OAuth method.

From what I wrote in #38, this would be allowing my option number 1 selector, not number 3.

The current way I use the API in my project does not require username+password, so switching to this library and adding extra credentials feels a bit wrong.

Oh, I see!
I totally misunderstood what you meant, my bad...
Making the username/password optional should be rather easy, let me see what I might come up with...

Update:
https://github.com/btw04/ticktick-py/tree/optional_password/mail
This is a rough draft for how this mode might work. I haven't tested everything and there surely are some exceptions that are caused if you use the mode and try to access something that simply won't work. You can help me test for those and finalize a PR if you want to.

I haven't noticed the update as it wasn't a new comment - do you still require testing of something?

Sure. I only tested some very simple functionality but I'm pretty sure that there are some use-cases where the mode breaks easely and with a nasty exception. You can just use the branch in your day-to-day and report any issues if you want to, especially since you requested this mode in the first place and it basically already delivers on it

I may be completely overlooking something but at this point I wasted enough time on this - is there not a way to list all projects?

What I need to do is

  1. List all projects by https://api.ticktick.com/open/v1/project
  2. Iterate on them to get further data https://api.ticktick.com/open/v1/project/{project['id']}/data

I am stumped on both counts, seems like these OpenAPI endpoints aren't implemented.

% grep -Ri 'data' 2>/dev/null
managers/tasks.py:        method allows for more natural input of data to the [`builder`][managers.tasks.TaskManager.builder]

Open API is not being actively developed/supported by ticktick developers it seems. So far, you can create tasks, you can get the projects and then for each project get the task list, but you can't get a list of tasks in the Inbox.
Meaning that any tasks which have not been moved to a List (folder/project) will not be retrievable.
This makes the whole Open API a bit useless.
I emailed them 3 times already regarding this without receiving any answer.