Skip to main content

The missing GCP Python Client Library

Project description

Toto9 - The Missing GCP Python Client

The Google Python Client Library is missing stuff! This package fills in the gaps.

Installation

Development Environment

Run pip install -e . from the root level of this repository. This symlinks the package so that source files are available as soon as they are updated.

Development

  • export GOOGLE_APPLICATION_CREDENTIALS=PATH_TO_YOUR_CREDENTIALS_FILE
  • export GOOGLE_PROJECT_ID=YOUR_PROJECT_ID (for tests)
  • virtualenv -p python3 venv
  • source venv/bin/activate
  • pip install -r requirements.txt
  • pip install -e .

All Other Environments

pip install toto9

Usage

Authentication

Set the GOOGLE_APPLICATION_CREDENTIALS environment variable to the path of your credentials. Alternatively, pass in the path to your credentials and list of scopes to the service classes with credentials_path and scopes kwargs.

Interacting with GCP Service Accounts

from toto9.serviceaccount import ServiceAccount\ project_id = 'foo-bar-project-id' service_account = ServiceAccount() sa_list = service_account.list(project_id) print(sa_list)

Contributing

  • Create an issue in gitlab
  • Write the code
  • Write tests, make sure they are meaningful and pass
  • Submit MR against issue
  • Merge

References

Test

You should test your modules! Tests are in the tests directory. Name your file test_*.py so the unittest module will pick it up.

Setup and Run

export GOOGLE_PROJECT_ID=YOUR_PROJECT_ID export GOOGLE_APPLICATION_CREDENTIALS=PATH_TO_YOUR_CREDENTIALS_FILE

Run all tests with python -m unittest.

TODO

  • DONE Testing
  • DONE create service account
  • DONE delete service account
  • DONE update service account
  • TODO map/unmap service account to project with role
  • TODO add/remove member to service account for ownership/management
  • TODO implement logic for assigning permissions
  • TODO write/update metadata in project
  • TODO use batch sometimes? https://developers.google.com/api-client-library/python/guide/batch
  • DONE make this a proper package

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

toto9-0.1.2.tar.gz (8.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

toto9-0.1.2-py3-none-any.whl (11.7 kB view details)

Uploaded Python 3

File details

Details for the file toto9-0.1.2.tar.gz.

File metadata

  • Download URL: toto9-0.1.2.tar.gz
  • Upload date:
  • Size: 8.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for toto9-0.1.2.tar.gz
Algorithm Hash digest
SHA256 201343ac748578a571a491630a638a54b4ad934726b9df3283b78c72a8257183
MD5 ba24edb0f52dbb65f02a5593d3b889e1
BLAKE2b-256 3efa2dd00d3681c1cdedb0afb17f011940bb1e296c9cba12f2447ebd7777f6ba

See more details on using hashes here.

File details

Details for the file toto9-0.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for toto9-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 e83a814c9351b4d7e8966f3c60099a5c939d9f552d7b334f28fde90c29dc54f4
MD5 5921a1ec6ba3459f49113a8abc7d66b5
BLAKE2b-256 12e7575ba9be54e7a9ea3718ec25ccf55d80abd7aa0ac071ea3b17fc3ac1a239

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page