Skip to main content
Version: Preview

Google Drive

Experimental
Creates:
AssetsLineage

Configure in the UI

This plugin can be configured directly in the Marmot UI with a step-by-step wizard.

View Guide

The Google Drive plugin catalogues the documents and sheets a team keeps in Drive, so the spreadsheet a report is actually built from is findable next to the warehouse tables feeding it.

What it discovers

Google DriveMarmot asset type
the drive itselfDrive
folderFolder
fileFile
Google SheetSpreadsheet
a sheet within a spreadsheetTable, with its header row as columns

The drive is the root of the tree: folders nest under it, and each file is linked to the folder holding it, so a drive is navigable from either end: the Contents tab on a folder lists what is inside it, and on a file it shows the folder it lives in.

These are the same asset types and names the OpenMetadata plugin produces for a Google Drive service. An organisation moving off OpenMetadata can import their drive from there and later point this plugin at Drive directly; the second run takes over the assets that are already in the catalog rather than creating a second copy.

Access

The plugin reads Drive with a Google service account.

A service account on its own only sees files that have been shared with its email address, which is a reasonable way to catalogue a handful of shared folders. To read a whole organisation's Drive, give the service account domain-wide delegation and set impersonate_user to a Workspace user to act as.

Enable the Google Drive API, and the Google Sheets API if you want the columns of each sheet. The scopes needed are:

https://www.googleapis.com/auth/drive.metadata.readonly
https://www.googleapis.com/auth/spreadsheets.readonly

Credentials follow Marmot's shared Google Cloud configuration: a key file, key JSON, or Application Default Credentials when nothing is set.

Example Configuration


credentials:
credentials_file: "/etc/marmot/gcp-service-account.json"
impersonate_user: "data-platform@company.com"
tags:
- "google-drive"

A single shared drive:


credentials:
credentials_file: "/etc/marmot/gcp-service-account.json"
drive_id: "0AItAbCdEfGhIjKlMnO"
exclude_mime_types:
- "application/vnd.google-apps.shortcut"

Configuration

The following configuration options are available:

PropertyTypeRequiredDescription
concurrencyintfalseParallel requests for the sheets of a spreadsheet
credentialsGCPCredentialsfalseGCP credentials configuration
drive_idstringfalseShared drive to read. Empty means the user's My Drive
exclude_mime_types[]stringfalseMIME types to skip, for example application/vnd.google-apps.shortcut
external_links[]ExternalLinkfalseExternal links to show on all assets
filterFilterfalseFilter discovered assets by name (regex)
folder_idstringfalseOnly discover this folder and everything under it
header_rowintfalseRow of a sheet that holds the column names
impersonate_userstringfalseWorkspace user to act as. Needed to read a whole organisation's Drive, and requires domain-wide delegation on the service account. Without it, only files shared with the service account are visible
include_filesboolfalseDiscover files, not just folders
include_spreadsheetsboolfalseDiscover Google Sheets, including each of their sheets
include_trashedboolfalseDiscover files in the trash
include_worksheetsboolfalseDiscover each sheet of a spreadsheet as a table, with its columns. Needs the Sheets read scope
max_filesintfalseStop after this many files. 0 means no limit
page_sizeintfalseFiles per API request
tagsTagsConfigfalseTags to apply to discovered assets

Available Metadata

The following metadata fields are available:

FieldTypeDescription
checksumstringFile checksum reported by Drive
column_countintNumber of columns in a sheet
drive_idstringGoogle Drive file id
file_extensionstringFile extension
file_typestringBroad kind of file, for example Document, Spreadsheet or Image
file_versionstringDrive version number
hiddenboolWhether the sheet is hidden
mime_typestringFile MIME type
modified_atstringWhen the item last changed in Drive
owners[]stringPeople who own the item in Drive
pathstringLocation within the drive
row_countint64Number of rows in a sheet
sharedboolWhether the item is shared
sizeint64Size in bytes
spreadsheetstringSpreadsheet a sheet belongs to