|
| 1 | +# [Markdown Obsidian Tasks](https://publish.obsidian.md/tasks/Introduction) ⬄ [Google Tasks](https://support.google.com/tasks/answer/7675772) |
| 2 | + |
| 3 | + |
| 4 | + |
| 5 | +## Description |
| 6 | + |
| 7 | +Given all tasks in your Google Task task list and a Markdown file with |
| 8 | +Obsidian tasks, synchronise all the addition / |
| 9 | +modification / deletion events between them. |
| 10 | + |
| 11 | +## Motivation |
| 12 | + |
| 13 | +While Obsidian Tasks is good for taking notes, tracking tasks across projects, |
| 14 | +keeping track of project goals etc., lacks the portability, simplicity and |
| 15 | +minimalistic design of Google Tasks. The latter also has the following |
| 16 | +advantages: |
| 17 | + |
| 18 | +- Automatic sync across all your devices |
| 19 | +- Comfortable addition/modification of events using voice commands |
| 20 | +- Actual reminding of events with a variety of mechanisms |
| 21 | + |
| 22 | +## Usage Examples |
| 23 | + |
| 24 | +Run the `md_gtasks_sync` to synchronise the Google Tasks list of your choice with |
| 25 | +the selected Markdown file. Run with `--help` for the list of options. |
| 26 | + |
| 27 | +```sh |
| 28 | +# Sync the +remindme Taskwarrior tag with the Google Tasks list named "TW Reminders" |
| 29 | + |
| 30 | +md_gtasks_sync --help |
| 31 | +md_gtasks_sync -m tasks.md -l "MD Tasks" |
| 32 | +``` |
| 33 | + |
| 34 | +## Installation |
| 35 | + |
| 36 | +### Package Installation |
| 37 | + |
| 38 | +Install the `syncall` package from PyPI, enabling the `google` and `md` |
| 39 | +extras: |
| 40 | + |
| 41 | +```sh |
| 42 | +pip3 install syncall[google,tw] |
| 43 | +``` |
| 44 | + |
| 45 | +## Notes re this synchronization |
| 46 | + |
| 47 | +- Currently subtasks of a Google Tasks item are treated as completely |
| 48 | + independent of the parent task when converted to Markdown |
| 49 | +- It's not possible to get the time part of the "due" field of a task using the |
| 50 | + Google Tasks API. Due to this restriction we currently do currently do sync |
| 51 | + the date part (without the time) from Google Tasks to Markdown, but in |
| 52 | + order not to remove the time part when doing the inverse synchronization, we |
| 53 | + don't sync the date at all from Markdown to Google Tasks. More |
| 54 | + information in [this ticket](https://issuetracker.google.com/u/1/issues/128979662) |
| 55 | + |
| 56 | +<details> |
| 57 | +<summary>Overriding Google Tasks API key (not required)</summary> |
| 58 | + |
| 59 | +**This step isn't since the Google Console app of this project is now verified.** |
| 60 | + |
| 61 | +At the moment the Google Console app that makes use of the Google Tasks API is |
| 62 | +still in Testing mode and awaiting approval from Google. This means that if it |
| 63 | +raches more than 100 users, the integration may stop working for you. In that |
| 64 | +case in order to use this integration you will have to register for your own |
| 65 | +developer account with the Google Tasks API with the following steps: |
| 66 | + |
| 67 | +Firstly, remove the `~/.gtasks_credentials.pickle` file on your system since |
| 68 | +that will be reused if found by the app. |
| 69 | + |
| 70 | +For creating your own Google Cloud Developer App: |
| 71 | + |
| 72 | +- Go to the [Google Cloud developer console](https://console.cloud.google.com/) |
| 73 | +- Make a new project |
| 74 | +- From the sidebar go to `API & Services` and once there click the `ENABLE APIS AND SERVICES` button |
| 75 | +- Look for and Enable the `Tasks API` |
| 76 | + |
| 77 | +Your newly created app now has access to the Tasks API. We now have to create |
| 78 | +and download the credentials: |
| 79 | + |
| 80 | +- Again, from the sidebar under `API And Services` click `Credentials` |
| 81 | +- In the Google Tasks API screen, click the `CREATE CREDENTIALS` button. |
| 82 | +- Select the `User data` radio button (not the `Application data`). |
| 83 | +- Fill in the `OAuth Consent Screen` information (shouldn't affect the process) |
| 84 | +- Allow the said credentials to access the following scopes: |
| 85 | + - `Create, edit, organize, and delete all your tasks` |
| 86 | + - `View your tasks` |
| 87 | +- Create a new `OAuth Client ID`. Set the type to `Desktop App` (app name is not |
| 88 | + important). |
| 89 | +- Finally download the credentials in JSON form by clicking the download button |
| 90 | + as shown below. This is the file you need to point to when running |
| 91 | + `tw_gtasks_sync`. |
| 92 | + |
| 93 | +  |
| 94 | + |
| 95 | +To specify your custom credentials JSON file use the `--google-secret` flag as follows: |
| 96 | + |
| 97 | +```sh |
| 98 | +md_gtasks_sync -l "<list-name>" -m tasks.md --google-secret "<path/to/downloaded/json/file>" |
| 99 | +``` |
| 100 | + |
| 101 | +</details> |
0 commit comments