Skip to main content

GSuite Exporter

This package handles exporting data from the GSuite Admin APIs to a destination.

The following GSuite Admin APIs are currently supported:

The following destinations are currently supported:

Requirements

  • A GSuite Admin account
  • A service account with:
  • On the service account's project:
    • Enable the Identity and Access Management (IAM) API.
  • On the destination project:
    • Enable the Admin Reports API.

Collectors

To collect data from the Admin SDK APIs, you need to grant extra permissions to your service account:

Exporters

Stackdriver Logging

To use the Stackdriver Logging exporter, you need to grant extra IAM roles to your service account:

  • roles/logging.viewer on the destination project
  • roles/logging.logWriter on the destination project

Installation

pip install gsuite-exporter

Usage

The GSuite Exporter can be used either using the command-line interface or as a Python library.

Using the CLI

An example sync from the Admin Reports API to Stackdriver Logging for the 'login' application looks like:

gsuite-exporter
  --credentials-path='/path/to/service/account/credentials.json'
  --admin-user='<your_gsuite_admin>@<your_domain>'
  --api='report_v1'
  --applications='login drive token'
  --project-id='<logging_project>'
  --exporter='stackdriver_exporter.StackdriverExporter'

The credentials_path variable is optional and you can use Application Default Credentials instead.

Using as a library

An example sync from the Admin Reports API to Stackdriver Logging looks like:

from gsuite_exporter.cli import sync_all

sync_all(
    credentials_path=/path/to/service/account/credentials.json,
    admin_user='<user>@<domain>',
    api='reports_v1',
    applications=['login', 'drive', 'token'],
    project_id='<project-id>',
    exporter_class='stackdriver_exporter.StackdriverExporter'
)

More examples are available using the library functions under the examples/ directory.

Metadata

Release files for gsuite-exporter 0.0.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for gsuite-exporter 0.0.4
File Size Uploaded
gsuite-exporter-0.0.4.tar.gz 9.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for gsuite-exporter 0.0.4
File Interpreter ABI Platform
gsuite_exporter-0.0.4-py3-none-any.whl Python 3 none any Details

Total release size: 22.6 kB

Release files / gsuite-exporter-0.0.4.tar.gz

Download URL gsuite-exporter-0.0.4.tar.gz
Size 9.3 kB
Tags Source
SHA-256 checksum
How to use checksums
0f2fd0707e522b06c64d8d780ef40bae04201784331250502e5aeb63114d7761
BLAKE2b-256 checksum
How to use checksums
1448e421b917e07753848eb4c05948639556d7d8611cfce2ab42ded47b05e3bf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.8.2

Release files / gsuite_exporter-0.0.4-py3-none-any.whl

Download URL gsuite_exporter-0.0.4-py3-none-any.whl
Size 13.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b7196b232675308c17a083006627f0320c2504d120a75c70b14b0f47f0d11afe
BLAKE2b-256 checksum
How to use checksums
90eb4ce3e1d22796882b5e7e298f0119a4df3c683b8b7234875649be02b054cc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.8.2

Release history Release notifications | RSS feed

This release

0.0.4 This release

2 release files

0.0.3

2 release files

0.0.2

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page