Skip to main content

gcloud config helper

This library allows you to use the current gcloud configuration credentials to authenticate with against the google APIs.

The library provides the class GCloudCredentials which wraps the gcloud config config-helper command.

To use:

import gcloud_config_helper
credentials, project = gcloud_config_helper.default()

Next you can pass these credentials in when constructing an API client:

from google.cloud import compute_v1
c = compute_v1.InstancesClient(credentials=credentials)
for zone, instances in c.aggregated_list(request={"project": project}):
    for instance in instances.instances:
        print(f'found {instance.name} in zone {zone}')

Note that Google documentation states that gcloud config config-helper should be regarded as an unstable interface.

if you want, you can use the gcloud_config_helper.on_path() to determine to use gcloud or the default credentials:

if google_config_helper.on_path():
   credentials, project = gcloud_config_helper.default()
else:
   logging.info("using application default credentials")
   credentials, project = google.auth.default()
https://img.shields.io/pypi/v/gcloud_config_helper.svg https://img.shields.io/travis/binxio/python-gcloud-config-helper.svg Documentation Status

obtain Google gcloud configuration credentials

  • Free software: Apache Software License 2.0

History

0.1.0 (2021-04-24)

  • First release on PyPI.

Metadata

Release files for gcloud-config-helper 0.3.1

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

Source distribution (sdist)

Source distribution for gcloud-config-helper 0.3.1
File Size Uploaded
gcloud_config_helper-0.3.1.tar.gz 11.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for gcloud-config-helper 0.3.1
File Interpreter ABI Platform
gcloud_config_helper-0.3.1-py2.py3-none-any.whl Python 2, Python 3 none any Details

Total release size: 16.4 kB

Release files / gcloud_config_helper-0.3.1.tar.gz

Download URL gcloud_config_helper-0.3.1.tar.gz
Size 11.2 kB
Tags Source
SHA-256 checksum
How to use checksums
a40d3612116a43c6db14f363cfe14860e7b1161c4c560ed29d9263e28ff2979e
BLAKE2b-256 checksum
How to use checksums
77fcc39b5e2410f59d5c989b54522e4e3cd3d89c07b82b8452a331a46c4feb8e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.7.13

Release files / gcloud_config_helper-0.3.1-py2.py3-none-any.whl

Download URL gcloud_config_helper-0.3.1-py2.py3-none-any.whl
Size 5.2 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
967f14a626b34b595e62a00311b66c3f68eed62f71d97a99ebad9e46eadf436f
BLAKE2b-256 checksum
How to use checksums
67c06bee73d1ad1e7481f01b257d8f292ceebcb7783169c787b5d2afe040a8ef
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.7.13

Release history Release notifications | RSS feed

This release

0.3.1 This release

2 release files

0.3.0

2 release files

0.2.3

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.0

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