Looker Studio
Prerequisites
Follow installation instructions here
You will need a Service Account with permissions to access Looker Studio. The instructions can be found here.
You will also need to provide the email of a Google Workspace user with admin access.
Optional: BigQuery access
If your Looker Studio data sources are connected to BigQuery:
Make sure to install the BigQuery dependencies as well:
pip install castor-extractor[lookerstudio,bigquery]
You will require a Service Account with BigQuery access. Consider using the Service Account linked to your BigQuery integration. Note that this can be the same Service Account as for Looker Studio, or a separate one.
Run extraction script
Once the package has been installed, you should be able to run the following command in your terminal:
castor-extract-looker-studio [arguments]
The script will run and display logs similar to the following:
INFO - Looker Studio credentials fetched from /looker/studio/credentials.json
INFO - BigQuery credentials fetched from /bigquery/credentials.json
INFO - Extracting ASSETS from API
INFO - Refreshing authentication token...
INFO - Refreshing authentication token...
...
INFO - Wrote output file: /tmp/ls/1742219344-summary.json
Command Arguments
Required Arguments
-c
,--credentials
: File path to Service Account credentials with Looker Studio access-a
,--admin-email
: Email of a Google Workspace user with admin access
Optional Arguments
-b
,--bigquery-credentials
: Optional file path to Service Account credentials with BigQuery access. This can be the same file path as for Looker Studio.-o
,--output
: Directory to write the extracted files to
You can also get help with the argument --help
Use ENV variables
If you don't want to specify arguments every time, you can set the following ENV variables in your .bashrc
:
[email protected]
CASTOR_OUTPUT_DIRECTORY=/tmp/catalog
GOOGLE_APPLICATION_CREDENTIALS=/path/to/credentials/service-account.json
Then the script can be executed without any arguments:
castor-extract-looker-studio
It can also be executed with partial arguments (the script looks in your ENV
as a fallback):
castor-extract-looker-studio --output /tmp/catalog
Last updated
Was this helpful?