Metadata-Version: 2.1
Name: gcp-python-client-functions
Version: 0.0.1
Summary: One package that will handle the installation and client generation for the most used  GCP Python Client Libraries + methods that avoid repetitive processes.
Home-page: https://github.com/datasciencedani/gcp-python-client-functions
Author: Daniela Zamora
Author-email: danizhorta24@gmail.com
License: Apache Software License 2.0
Keywords: nbdev jupyter notebook python google api bigquery storage
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Natural Language :: English
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: License :: OSI Approved :: Apache Software License
Requires-Python: >=3.7
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: google
Requires-Dist: google-cloud-bigquery
Requires-Dist: pandas
Requires-Dist: db-dtypes
Requires-Dist: fsspec
Requires-Dist: gcsfs
Requires-Dist: google-cloud-storage
Requires-Dist: fastcore
Provides-Extra: dev
Requires-Dist: google ; extra == 'dev'
Requires-Dist: google-cloud-bigquery ; extra == 'dev'
Requires-Dist: pandas ; extra == 'dev'
Requires-Dist: db-dtypes ; extra == 'dev'
Requires-Dist: fsspec ; extra == 'dev'
Requires-Dist: gcsfs ; extra == 'dev'
Requires-Dist: google-cloud-storage ; extra == 'dev'
Requires-Dist: fastcore ; extra == 'dev'

# GCP Python Client Functions

<!-- WARNING: THIS FILE WAS AUTOGENERATED! DO NOT EDIT! -->

## Installation

Launch a terminal and install by entering:

``` sh
conda install gcp_python_client_functions
```

…or

``` sh
pip install gcp_python_client_functions
```

## Usage Prerequisites

### 1. GCP environment

- Create a GCP project by going to the [Resource
  Manager](https://console.cloud.google.com/project?_ga=2.198902124.2143434848.1693760593-97706481.1691864848)
  page in the cloud console ([cloud resources naming
  convention](https://stepan.wtf/cloud-naming-convention/#:~:text=The%20rule%20of%20thumb%20is,or%20within%20a%20given%20scope.)).
- Enable billing for the project you’ll work with by going to the [Cloud
  Billing](https://console.cloud.google.com/billing/) page and selecting
  your project on the top right corner (300 USD free credits are
  associated with new billing accounts + a [big list of free tier
  products](https://cloud.google.com/free?_ga=2.49992806.-1313173218.1693453955)).
- Enable BigQuery API by going to [APIs &
  Services](https://console.cloud.google.com/apis/) page on the cloud
  console and looking for the BigQuery API.

### 2. Authentication

[Authenticating](https://googleapis.dev/python/google-api-core/latest/auth.html)
by… - (locally) using the [Google Cloud
SDK](http://cloud.google.com/sdk)(installation needed). Launch a
terminal enter:

``` sh
gcloud auth login --update-adc
```

- (elsewhere) [downloading a service account JSON
  keyfile](https://cloud.google.com/iam/docs/keys-create-delete#creating)
  and point to it using an environment variable:

``` sh
export GOOGLE_APPLICATION_CREDENTIALS="/path/to/keyfile.json"
```

- or through [Workflow Identity
  Provider](https://docs.github.com/en/actions/deployment/security-hardening-your-deployments/configuring-openid-connect-in-google-cloud-platform)
  (what we used to authenticate within GitHub Actions, see [Cloud
  Advocate’s video](https://www.youtube.com/watch?v=zRF5uTWXV8Y) and
  [stackoverflow
  question](https://stackoverflow.com/questions/75573270/github-action-doesnt-work-with-gcp-403-permission-iam-serviceaccounts-getacc)
  for additional support).

## How to use

``` python
from gcp_python_client_functions.clients import *

PROJECT_ID = 'dz-learning-d'

# BigQuery
bq_obj = BigQuery(PROJECT_ID)

# Cloud Storage
stg_obj = Storage(PROJECT_ID)
```
