<SYSTEM_TASK:>
Given the following text description, write Python code to implement the functionality described below step by step
<END_TASK>
<USER_TASK:>
Description:
 Column Mapping
Use sheet to define keyword to column mappings.
License
Copyright 2020 Google LLC,
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
https
Step1:  2. Get Cloud Project ID
To run this recipe requires a Google Cloud Project, this only needs to be done once, then click play.
Step2:  3. Get Client Credentials
To read and write to various endpoints requires downloading client credentials, this only needs to be done once, then click play.
Step3:  4. Enter Column Mapping Parameters
For the sheet, provide the full URL.
A tab called <strong>Mapping</strong> will be created.
Follow the instructions in the tab to complete the mapping.
The in table should have the columns you want to map.
The out view will have the new columns created in the mapping.
Modify the values below for your use case, can be done multiple times, then click play.
Step4:  5. Execute Column Mapping
This does NOT need to be modified unless you are changing the recipe, click play.
<ASSISTANT_TASK:>
Python Code:
!pip install git+https://github.com/google/starthinker
Explanation: Column Mapping
Use sheet to define keyword to column mappings.
License
Copyright 2020 Google LLC,
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Disclaimer
This is not an officially supported Google product. It is a reference implementation. There is absolutely NO WARRANTY provided for using this code. The code is Apache Licensed and CAN BE fully modified, white labeled, and disassembled by your team.
This code generated (see starthinker/scripts for possible source):
  - Command: "python starthinker_ui/manage.py colab"
  - Command: "python starthinker/tools/colab.py [JSON RECIPE]"
1. Install Dependencies
First install the libraries needed to execute recipes, this only needs to be done once, then click play.
End of explanation
CLOUD_PROJECT = 'PASTE PROJECT ID HERE'
print("Cloud Project Set To: %s" % CLOUD_PROJECT)
Explanation: 2. Get Cloud Project ID
To run this recipe requires a Google Cloud Project, this only needs to be done once, then click play.
End of explanation
CLIENT_CREDENTIALS = 'PASTE CLIENT CREDENTIALS HERE'
print("Client Credentials Set To: %s" % CLIENT_CREDENTIALS)
Explanation: 3. Get Client Credentials
To read and write to various endpoints requires downloading client credentials, this only needs to be done once, then click play.
End of explanation
FIELDS = {
  'auth_read': 'user',  # Credentials used for reading data.
  'sheet': '',
  'tab': '',
  'in_dataset': '',
  'in_table': '',
  'out_dataset': '',
  'out_view': '',
}
print("Parameters Set To: %s" % FIELDS)
Explanation: 4. Enter Column Mapping Parameters
For the sheet, provide the full URL.
A tab called <strong>Mapping</strong> will be created.
Follow the instructions in the tab to complete the mapping.
The in table should have the columns you want to map.
The out view will have the new columns created in the mapping.
Modify the values below for your use case, can be done multiple times, then click play.
End of explanation
from starthinker.util.configuration import Configuration
from starthinker.util.configuration import execute
from starthinker.util.recipe import json_set_fields
USER_CREDENTIALS = '/content/user.json'
TASKS = [
  {
    'mapping': {
      'auth': 'user', 
      'sheet': {'field': {'name': 'sheet', 'kind': 'string', 'order': 1, 'default': ''}}, 
      'tab': {'field': {'name': 'tab', 'kind': 'string', 'order': 2, 'default': ''}}, 
      'in': {
        'dataset': {'field': {'name': 'in_dataset', 'kind': 'string', 'order': 3, 'default': ''}}, 
        'table': {'field': {'name': 'in_table', 'kind': 'string', 'order': 4, 'default': ''}}
      }, 
      'out': {
        'dataset': {'field': {'name': 'out_dataset', 'kind': 'string', 'order': 7, 'default': ''}}, 
        'view': {'field': {'name': 'out_view', 'kind': 'string', 'order': 8, 'default': ''}}
      }
    }
  }
]
json_set_fields(TASKS, FIELDS)
execute(Configuration(project=CLOUD_PROJECT, client=CLIENT_CREDENTIALS, user=USER_CREDENTIALS, verbose=True), TASKS, force=True)
Explanation: 5. Execute Column Mapping
This does NOT need to be modified unless you are changing the recipe, click play.
End of explanation
<END_TASK>