Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file has been truncated, but you can view the full file.
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
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 requests | |
import json | |
import pandas as pd | |
from io import StringIO | |
import time | |
url = "https://api.beta.ons.gov.uk/v1/filters?submitted=true" | |
ages = range(0,90) | |
ages = [str(a) for a in ages] | |
years = [2015,2016,2017] |
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 requests | |
import json | |
import pandas as pd | |
from io import StringIO | |
import time | |
url = "https://api.beta.ons.gov.uk/v1/filters?submitted=true" | |
post = { | |
"dataset": { |
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
{"$schema": "https://vega.github.io/schema/vega/v3.0.json", | |
"width": 500, | |
"height": 600, | |
"autosize": "none", | |
"signals": [ | |
{ | |
"name": "translate0", | |
"update": "width / 2" | |
}, | |
{ |
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
from airflow import DAG | |
from airflow.operators.bash_operator import BashOperator | |
from datetime import datetime, timedelta | |
default_args = { | |
'owner': 'airflow', | |
'depends_on_past': False, | |
'start_date': datetime(2018,10,1), |
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
{ | |
"quoteResponse": { | |
"result": [ | |
{ | |
"currency": "USD", | |
"esgPopulated": false, | |
"exchange": "CCY", | |
"exchangeDataDelayedBy": 0, | |
"exchangeTimezoneName": "Europe/London", | |
"exchangeTimezoneShortName": "GMT", |
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
{ | |
"$schema": "http://json-schema.org/draft-07/schema#", | |
"type": "object", | |
"title": "Metadata", | |
"description": "MoJ Data Catalogue Metadata", | |
"properties": { | |
"id": { | |
"type": "string", | |
"title": "The ID of this table. Unique identifier which enables a table's metadata to refer to another table using e.g. for a foreign key", | |
"examples": [ |
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 re | |
def get_create_table_string(tablename, connection): | |
sql = """ | |
select * from sqlite_master where name = "{}" and type = "table" | |
""".format(tablename) | |
result = connection.execute(sql) | |
create_table_string = result.fetchmany()[0][4] | |
return create_table_string |
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
license: mit |
NewerOlder