Google Cloud Pilot¶
Google Cloud Pilot (gcp-pilot) is a Python library that simplifies interaction with Google Cloud Platform services. It provides a high-level, user-friendly interface to various GCP APIs, handling authentication, error management, and parameter fallback automatically.
Installation¶
Some APIs need extra packages, thus you must use extras
to add them:
pip install gcp-pilot[tasks] # (1)!
pip install gcp-pilot[build] # (2)!
pip install gcp-pilot[storage] # (3)!
pip install gcp-pilot[bigquery] # (4)!
pip install gcp-pilot[speech] # (5)!
pip install gcp-pilot[sheets] # (6)!
pip install gcp-pilot[pubsub] # (7)!
pip install gcp-pilot[datastore] # (8)!
pip install gcp-pilot[dns] # (9)!
pip install gcp-pilot[secret] # (10)!
pip install gcp-pilot[healthcare] # (11)!
pip install gcp-pilot[iam] # (12)!
- Cloud Tasks
- Cloud Build
- Cloud Storage
- Big Query
- Speech
- Sheets
- Pub/Sub
- Datastore
- Cloud DNS
- Secret Manager
- Healthcare Engine
- IAM
Basic Usage¶
Why Use gcp-pilot¶
"Since Google already has a generic API client and so many specific clients, why should I use this library?"
Google has 2 types of clients:
-
dedicated: custom-made for the APIs. They are excellent: they implement high level interaction with the API with friendly methods. The
gcp-pilot
adds value by handling authentication, friendly errors and parameter fallback. -
generic: a single client that is capable of dynamically calling any REST API. They are a pain to use: very specific calls that must be translated from the documentation. The
gcp-pilot
comes in handy to add high-level interaction with friendly methods such asCalendar.create_event
, on top of all other advantages cited above.
Key Features¶
- Parameter Fallback: Automatically detects project_id and location based on your credentials
- Friendly Errors: Converts generic HttpExceptions into more specific exceptions like NotFound, AlreadyExists, etc.
- Auto-Authorization: Sets up required permissions for services that need specific authorizations
- Integration: Seamlessly integrates different GCP services
- Authentication Handling: Uses Application Default Credentials with support for impersonation and delegation
Supported Services¶
gcp-pilot supports a wide range of Google Cloud Platform services. Each service has its own dedicated documentation page with detailed usage examples: