Skip to content

Instantly share code, notes, and snippets.

View artpel's full-sized avatar

Arthur P. artpel

  • Paris, France
View GitHub Profile
@artpel
artpel / looker_client.py
Last active February 10, 2022 11:35
Looker API Python Client
import json
import os
import looker_sdk
class LookerClient:
# This is the Looker client to communicate to Looker API with their SDK
# and fetch our content metadata
# We don't fetch all the data from the response as they have a **lot** of useless fields and
# it's heavily memory-consuming
/* Copyright (c) 2018 Looker Data Sciences, Inc. See https://github.com/looker-open-source/look-at-me-sideways/blob/master/LICENSE.txt */
const getExemption = require('../lib/get-exemption.js');
module.exports = function(
project,
) {
let messages = [];
let rule = 'test';
let exempt;
if (exempt = getExemption(project.manifest, rule)) {
// Creating file name for path and downloading file
let formattedDate = moment.unix(Date.now()/1000).format("DDMMYYYY-HHmmss");
let path = "audio-temp" + formattedDate +".flac";
await audioDownloader(path, verbatimData.val().record.urlFlac)
// Opening File and creating base64 binary file
const audioBase64 = fs.readFileSync(path).toString('base64')
// Getting size of File
const stats = fs.statSync(path)