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()
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)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| gcloud_config_helper-0.3.1.tar.gz | 11.2 kB | Without provenance | Details for gcloud_config_helper-0.3.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| gcloud_config_helper-0.3.1-py2.py3-none-any.whl | Python 2, Python 3 | none | any | Details for gcloud_config_helper-0.3.1-py2.py3-none-any.whl |
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
|
Security for gcloud-config-helper 0.3.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.