This connector has been tested against a local stand-in for Google’s API, not against Google itself. Run it with --dry-run first.

What it does

  • Walks each folder and its subfolders.
  • Exports Google Docs as Markdown, or as plain text when Markdown export is not available.
  • Downloads .md, .markdown and .txt files.
  • Skips everything else.
  • Writes each document to raw/gdrive/<modified date>-<name>.md with its Drive link.
Access is read-only. The connector asks Google only for the drive.readonly scope.

Credentials

Set one of these in the environment.
  1. In Google Cloud, enable the Drive API and create a service account with a JSON key.
  2. Share each Drive folder with the service account’s email address.
  3. Install the extra and point to the key file:
Keep key files and tokens out of the vault repository.

Revisions

Sources are never changed after import, so each version of a document is its own source. A path that was once given to a source is never given to a different one, so existing citations keep pointing at the same text.

Failures

If Google returns an error partway through, the command stops with that error. Documents imported before the failure are recorded, and the next run continues without creating second copies.