This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
WITH | |
columns AS ( | |
SELECT | |
" " || "- name: " || column_name || "\n" || | |
" " || ' description: "' || column_name || '"' AS column_statement, | |
table_name | |
FROM | |
`rj-smtr.veiculo`.INFORMATION_SCHEMA.COLUMNS ), | |
tables AS ( | |
SELECT |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import csv | |
import gzip | |
import io | |
import json | |
from urllib.parse import urlencode, urljoin | |
from urllib.request import Request, urlopen | |
class BrasilIO: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def accessr(d, keys, default=None): | |
if len(keys) and d is not None: | |
return accessr(d.get(keys[0], default), keys[1:], default) | |
else: | |
return d | |
def access(d, keys, default=None): | |
for k in keys: | |
if d is not None: | |
d = d.get(k, default) |