Skip to content

Instantly share code, notes, and snippets.

View horken7's full-sized avatar

Johan Larsson Hörkén horken7

View GitHub Profile
@horken7
horken7 / booli_example_request.py
Created October 12, 2017 06:54
Booli API Python3.6
import time
import requests
from hashlib import sha1
import random
import string
import json
"""
Make a sample call to the Booli API asking for all listings in 'Nacka' in JSON format,
@horken7
horken7 / exec_sql_file.py
Last active July 18, 2017 16:11
Python execute SQL file
def exec_sql_file(self, cursor, sql_file):
"""
Function that executes an SQL script file. Executed query by query by looking through the file and adding
elements to 'statement' until if finds the delimiter symbol ';', whilst ignoring comments and
stripping space, tab and newline characters.
:param cursor: cursor, connected to correct database
:param sql_file: string, file location
:return: void
"""