Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 47 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,11 @@ At the moment the list of supported synchronizations is the following:
<td> <a href="https://taskwarrior.org/">Taskwarrior</a> ⬄ Generic <a href="https://en.wikipedia.org/wiki/CalDAV">Caldav </a> server</td>
<td><tt>tw-caldav-sync</tt></td>
</tr>
<tr>
<td><a href="https://github.com/bergercookie/syncall/blob/master/docs/readme-md-gtasks.md">README</a></td>
<td> <a href="https://publish.obsidian.md/tasks/Introduction">Obsidian Markdown Taks</a> ⬄ <a href="https://support.google.com/tasks/answer/7675772">Google Tasks</a></td>
<td><tt>md-gtasks-sync</tt></td>
</tr>
<tr>
<td><a href="https://github.com/bergercookie/syncall/blob/master/docs/readme-fs-gkeep.md">README</a></td>
<td> Local Files ⬄ <a href="https://www.google.com/keep/">Google Keep Notes</a></td>
Expand Down Expand Up @@ -510,6 +515,48 @@ Options:
</details>

<!-- END sniff-and-replace -->
<!-- START sniff-and-replace md_gtasks_sync --help START -->

<details>
<summary><tt>md_gtasks_sync --help</tt></summary>

```
Usage: md_gtasks_sync [OPTIONS]

Synchronize lists from your Google Tasks with Obsidian Tasks Markdown file.

The list of MD tasks can be based on a Markdown file path
while the list in GTasks should be provided by their name. if it doesn't
exist it will be created.

Options:
-l, --gtasks-list TEXT Name of the Google Tasks list to synchronize
(will be created if not there)
--google-secret FILE Override the client secret used for the
communication with the Google APIs
--oauth-port INTEGER Port to use for OAuth Authentication with
Google Applications
-m, --markdown-file TEXT Name of the Markdown file including tasks
list to synchronize
--list-combinations List the available named TW<->Google Tasks
combinations
--list-resolution-strategies List all the available resolution strategies
and exit
-r, --resolution-strategy [MostRecentRS|LeastRecentRS|AlwaysFirstRS|AlwaysSecondRS]
Resolution strategy to use during conflicts
-b, --combination TEXT Name of an already saved TW<->Google Tasks
combination
-s, --save-as TEXT Save the given TW<->Google Tasks filters
combination using a specified custom name.
--prefer-scheduled-date Prefer using the "scheduled" date field
instead of the "due" date if the former is
available
-v, --verbose
--version Show the version and exit.
--help Show this message and exit.
```

</details>

## Mechanics / Automatic synchronization

Expand Down
101 changes: 101 additions & 0 deletions docs/readme-md-gtasks.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
# [Markdown Obsidian Tasks](https://publish.obsidian.md/tasks/Introduction) ⬄ [Google Tasks](https://support.google.com/tasks/answer/7675772)

![logo](../misc/meme-md-gtasks.png)

## Description

Given all tasks in your Google Task task list and a Markdown file with
Obsidian tasks, synchronise all the addition /
modification / deletion events between them.

## Motivation

While Obsidian Tasks is good for taking notes, tracking tasks across projects,
keeping track of project goals etc., lacks the portability, simplicity and
minimalistic design of Google Tasks. The latter also has the following
advantages:

- Automatic sync across all your devices
- Comfortable addition/modification of events using voice commands
- Actual reminding of events with a variety of mechanisms

## Usage Examples

Run the `md_gtasks_sync` to synchronise the Google Tasks list of your choice with
the selected Markdown file. Run with `--help` for the list of options.

```sh
# Sync the +remindme Taskwarrior tag with the Google Tasks list named "TW Reminders"

md_gtasks_sync --help
md_gtasks_sync -m tasks.md -l "MD Tasks"
```

## Installation

### Package Installation

Install the `syncall` package from PyPI, enabling the `google` and `md`
extras:

```sh
pip3 install syncall[google,tw]
```

## Notes re this synchronization

- Currently subtasks of a Google Tasks item are treated as completely
independent of the parent task when converted to Markdown
- It's not possible to get the time part of the "due" field of a task using the
Google Tasks API. Due to this restriction we currently do currently do sync
the date part (without the time) from Google Tasks to Markdown, but in
order not to remove the time part when doing the inverse synchronization, we
don't sync the date at all from Markdown to Google Tasks. More
information in [this ticket](https://issuetracker.google.com/u/1/issues/128979662)

<details>
<summary>Overriding Google Tasks API key (not required)</summary>

**This step isn't since the Google Console app of this project is now verified.**

At the moment the Google Console app that makes use of the Google Tasks API is
still in Testing mode and awaiting approval from Google. This means that if it
raches more than 100 users, the integration may stop working for you. In that
case in order to use this integration you will have to register for your own
developer account with the Google Tasks API with the following steps:

Firstly, remove the `~/.gtasks_credentials.pickle` file on your system since
that will be reused if found by the app.

For creating your own Google Cloud Developer App:

- Go to the [Google Cloud developer console](https://console.cloud.google.com/)
- Make a new project
- From the sidebar go to `API & Services` and once there click the `ENABLE APIS AND SERVICES` button
- Look for and Enable the `Tasks API`

Your newly created app now has access to the Tasks API. We now have to create
and download the credentials:

- Again, from the sidebar under `API And Services` click `Credentials`
- In the Google Tasks API screen, click the `CREATE CREDENTIALS` button.
- Select the `User data` radio button (not the `Application data`).
- Fill in the `OAuth Consent Screen` information (shouldn't affect the process)
- Allow the said credentials to access the following scopes:
- `Create, edit, organize, and delete all your tasks`
- `View your tasks`
- Create a new `OAuth Client ID`. Set the type to `Desktop App` (app name is not
important).
- Finally download the credentials in JSON form by clicking the download button
as shown below. This is the file you need to point to when running
`tw_gtasks_sync`.

![download-btn](../misc/gcal-json-btn.png)

To specify your custom credentials JSON file use the `--google-secret` flag as follows:

```sh
md_gtasks_sync -l "<list-name>" -m tasks.md --google-secret "<path/to/downloaded/json/file>"
```

</details>
Binary file added misc/meme-md-gtasks.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading