Skip to content

Instantly share code, notes, and snippets.

View lukwam's full-sized avatar
:octocat:

Lukas Karlsson lukwam

:octocat:
View GitHub Profile
@lukwam
lukwam / helpers.py
Last active March 29, 2021 20:53
Workday transform main.py
# -*- coding: utf-8 -*-
"""Helpers for Workday People Transform."""
import datetime
import json
import logging
import os
import re
from unidecode import unidecode
from google.oauth2 import service_account
systemgrp:*:0
staff:*:10
sa:*:16
dba:*:40
oinstall:*:41
genomegrp:*:50
sequence1:*:52
sequence2:*:52
sequence3:*:52
sequence:*:52
def auth_stored_credentials(self, scopes=[]):
"""Authorize stored credentials."""
# this has a dependence on oauth2client
if not scopes:
scopes = self.client_scopes
try:
parser = argparse.ArgumentParser(parents=[tools.argparser])
parser.add_argument('args', nargs=argparse.REMAINDER)
flags = parser.parse_args()
flags.noauth_local_webserver = True
@lukwam
lukwam / gist:1c738349ff48da61cdff90638589f01c
Last active March 24, 2017 18:01
function to run bigquery.projects().list()
def get_projects(self, credentials):
"""Return list of BigQuery projects."""
bq = build('bigquery', 'v2', credentials=credentials)
projects = bq.projects()
request = projects.list(maxResults=10)
google_projects = []
while request is not None:
projects_list = request.execute()

Keybase proof

I hereby claim:

  • I am lukwam on github.
  • I am lukwam (https://keybase.io/lukwam) on keybase.
  • I have a public key whose fingerprint is 255E B60D A093 3D08 99E4 6CC5 5F3C BD47 5593 1D62

To claim this, I am signing this object: