Skip to content

Instantly share code, notes, and snippets.

@nmashton
Last active August 29, 2015 14:04
Show Gist options
  • Save nmashton/442cea7f852ee92c343e to your computer and use it in GitHub Desktop.
Save nmashton/442cea7f852ee92c343e to your computer and use it in GitHub Desktop.
Code to process the Armenia BOOST dataset.
import unicodecsv as csv
import os
import uuid
# Get the path to the file, which is assumed
# to be in the same directory as the script.
path = os.path.join(os.getcwd(), "armenia-edited.csv")
# Open a CSV reader on the file and read in its contents.
with open(path) as f:
initial_data = []
for row in csv.reader(f):
initial_data.append(row)
# Separate rows into three collections of rows,
# one each for "approved", "adjusted", and "executed"
# sums.
data_by_status = {"approved": [],
"adjusted": [],
"executed": []}
for row in initial_data:
data_by_status["approved"].append(row[:20])
data_by_status["adjusted"].append(row[:19] + [row[20]])
data_by_status["executed"].append(row[:19] + [row[21]])
# Split up each of the three datasets by year.
# Here, we do this by creating three dictionaries
# where the dictionary keys are the years contained in the data.
data_by_year = {"approved": {},
"adjusted": {},
"executed": {}}
# Check if a row's year (row[0]) is already a key in
# the dictionary of years. If not, create a new list
# as the value of the key. Then append the row to the
# list.
def add_row(object,dataset,row):
if not object.has_key(row[0]):
object[row[0]] = []
object[row[0]].append(row)
# For each status, push its years onto the data_by_year dictionary.
for status in data_by_year.keys():
for row in data_by_status[status][1:]:
add_row(data_by_year[status], data_by_status[status], row)
# Having segregated all the datasets, we can now do the remaining
# processing steps that call for Python.
# These include adding unique IDs and cleaning up COFOG cods.
# First, fixing IDs.
# This adds a new ID column to each dataset and assigns
# a random UUID value to each row.
def add_id(row):
# Adds a UUID to a row.
row.append(uuid.uuid4().hex)
def add_uuids():
for status in data_by_year.keys():
years = data_by_year[status].keys()
for year in years:
for row in data_by_year[status][year][1:]:
add_id(row)
add_uuids()
# Next, fixing COFOG values.
# In the source data, all COFOG values are in the form of
# strings consisting of an even number of digits.
# These codes cover COFOG levels 1, 2, and 3. To translate
# them back into the original COFOG format, we need to
# trim extra digits from levels 2 and 3, retain the padded
# form of level 1, and join levels with periods.
def chunkstring(string, length):
# Splits a string into a list of chunks of length 'length'.
return (string[0+i:length+i] for i in range(0, len(string), length))
def no0(chunk):
# Removes initial 0s from a string of 2 digits.
if chunk[0] == "0":
return chunk[1:]
else:
return chunk
def fix_cofog(cofog):
# Repairs a COFOG value of any kind.
if len(cofog) % 2 == 1:
# If a COFOG value has an odd number of digits,
# then it presumably needs an initial 0.
cofog = "0" + cofog
split = list(chunkstring(cofog,2))
if len(split) > 1:
split = [split[0]] + map(no0, split[1:])
return ".".join(split)
# Armed with these functions, we can fix the dataset.
# We will clean existing COFOG columns and also add
# a new one, to preserve the original dataset's columns.
def fix_cofog_row(row):
row[11] = fix_cofog(row[11])
row[13] = fix_cofog(row[13])
row[15] = fix_cofog(row[15])
def fix_cofog_dataset(rows):
for row in rows[1:]:
fix_cofog_row(row)
def fix_all_cofog():
for status in data_by_year.keys():
years = data_by_year[status].keys()
for year in years:
fix_cofog_dataset(data_by_year[status][year])
fix_all_cofog()
def add_new_cofog_column():
for status in data_by_year.keys():
for year in data_by_year[status].keys():
for row in data_by_year[status][year][1:]:
row.append(row[15])
add_new_cofog_column()
# Let's fix the headers of each dataset.
# These are all the same.
# For convenience, they are given here as a list.
headers = ["year","adminID","admin","economicID_level1",
"economic_level1","economicID_level2","economic_level2",
"economicID_level3","economic_level3","economicID","economic",
"cofog1code","cofog1label","cofog2code","cofog2label","cofog3code",
"cofog3label","programID","type","amount","id","cofog"]
# Change all the headers.
for status in data_by_year.keys():
for year in data_by_year[status].keys():
data_by_year[status][year][0] = headers
# Now just write out new CSV files. Hurray!
def write_csvs():
for status in data_by_year.keys():
for year in data_by_year[status].keys():
filename = "-".join(["armenia",status,year])
with open(os.path.join(os.getcwd(), filename + ".csv"), "w") as f:
writer = csv.writer(f)
writer.writerows(data_by_year[status][year])
write_csvs()
{
"datapackage_version": "1.0-beta.7",
"name": "armenia-example",
"title": "Example data: Armenia BOOST",
"description": "The full Armenia BOOST dataset, transformed into a valid Budget Data Package.",
"version": "0.0.1",
"resources": [
{
"path": "./armenia-approved-2006.csv",
"name": "armenia-approved-2006",
"currency": "AMD",
"dateLastUpdated": "2013-12-17",
"datePublished": "2012-02-13",
"fiscalYear": "2006",
"granularity": "aggregated",
"standard": "prerelease-MayDay",
"status": "approved",
"type": "expenditure",
"schema": {
"primaryKey": "id",
"fields": [
{
"name": "year",
"type": "date"
},
{
"name": "adminID",
"type": "string"
},
{
"name": "admin",
"type": "string"
},
{
"name": "economicID_level1",
"type": "string"
},
{
"name": "economic_level1",
"type": "string"
},
{
"name": "economicID_level2",
"type": "string"
},
{
"name": "economic_level2",
"type": "string"
},
{
"name": "economicID_level3",
"type": "string"
},
{
"name": "economic_level3",
"type": "string"
},
{
"name": "economicID",
"type": "string"
},
{
"name": "economic",
"type": "string"
},
{
"name": "cofog1code",
"type": "string"
},
{
"name": "cofog1label",
"type": "string"
},
{
"name": "cofog2code",
"type": "string"
},
{
"name": "cofog2label",
"type": "string"
},
{
"name": "cofog3code",
"type": "string"
},
{
"name": "cofog3label",
"type": "string"
},
{
"name": "programID",
"type": "string"
},
{
"name": "type",
"type": "string"
},
{
"name": "amount",
"type": "float"
},
{
"name": "id",
"type": "string"
},
{
"name": "cofog",
"type": "string"
}
]
}
},
{
"path": "./armenia-approved-2007.csv",
"name": "armenia-approved-2007",
"currency": "AMD",
"dateLastUpdated": "2013-12-17",
"datePublished": "2012-02-13",
"fiscalYear": "2007",
"granularity": "aggregated",
"standard": "prerelease-MayDay",
"status": "approved",
"type": "expenditure",
"schema": {
"primaryKey": "id",
"fields": [
{
"name": "year",
"type": "date"
},
{
"name": "adminID",
"type": "string"
},
{
"name": "admin",
"type": "string"
},
{
"name": "economicID_level1",
"type": "string"
},
{
"name": "economic_level1",
"type": "string"
},
{
"name": "economicID_level2",
"type": "string"
},
{
"name": "economic_level2",
"type": "string"
},
{
"name": "economicID_level3",
"type": "string"
},
{
"name": "economic_level3",
"type": "string"
},
{
"name": "economicID",
"type": "string"
},
{
"name": "economic",
"type": "string"
},
{
"name": "cofog1code",
"type": "string"
},
{
"name": "cofog1label",
"type": "string"
},
{
"name": "cofog2code",
"type": "string"
},
{
"name": "cofog2label",
"type": "string"
},
{
"name": "cofog3code",
"type": "string"
},
{
"name": "cofog3label",
"type": "string"
},
{
"name": "programID",
"type": "string"
},
{
"name": "type",
"type": "string"
},
{
"name": "amount",
"type": "float"
},
{
"name": "id",
"type": "string"
},
{
"name": "cofog",
"type": "string"
}
]
}
},
{
"path": "./armenia-approved-2008.csv",
"name": "armenia-approved-2008",
"currency": "AMD",
"dateLastUpdated": "2013-12-17",
"datePublished": "2012-02-13",
"fiscalYear": "2008",
"granularity": "aggregated",
"standard": "prerelease-MayDay",
"status": "approved",
"type": "expenditure",
"schema": {
"primaryKey": "id",
"fields": [
{
"name": "year",
"type": "date"
},
{
"name": "adminID",
"type": "string"
},
{
"name": "admin",
"type": "string"
},
{
"name": "economicID_level1",
"type": "string"
},
{
"name": "economic_level1",
"type": "string"
},
{
"name": "economicID_level2",
"type": "string"
},
{
"name": "economic_level2",
"type": "string"
},
{
"name": "economicID_level3",
"type": "string"
},
{
"name": "economic_level3",
"type": "string"
},
{
"name": "economicID",
"type": "string"
},
{
"name": "economic",
"type": "string"
},
{
"name": "cofog1code",
"type": "string"
},
{
"name": "cofog1label",
"type": "string"
},
{
"name": "cofog2code",
"type": "string"
},
{
"name": "cofog2label",
"type": "string"
},
{
"name": "cofog3code",
"type": "string"
},
{
"name": "cofog3label",
"type": "string"
},
{
"name": "programID",
"type": "string"
},
{
"name": "type",
"type": "string"
},
{
"name": "amount",
"type": "float"
},
{
"name": "id",
"type": "string"
},
{
"name": "cofog",
"type": "string"
}
]
}
},
{
"path": "./armenia-approved-2009.csv",
"name": "armenia-approved-2009",
"currency": "AMD",
"dateLastUpdated": "2013-12-17",
"datePublished": "2012-02-13",
"fiscalYear": "2009",
"granularity": "aggregated",
"standard": "prerelease-MayDay",
"status": "approved",
"type": "expenditure",
"schema": {
"primaryKey": "id",
"fields": [
{
"name": "year",
"type": "date"
},
{
"name": "adminID",
"type": "string"
},
{
"name": "admin",
"type": "string"
},
{
"name": "economicID_level1",
"type": "string"
},
{
"name": "economic_level1",
"type": "string"
},
{
"name": "economicID_level2",
"type": "string"
},
{
"name": "economic_level2",
"type": "string"
},
{
"name": "economicID_level3",
"type": "string"
},
{
"name": "economic_level3",
"type": "string"
},
{
"name": "economicID",
"type": "string"
},
{
"name": "economic",
"type": "string"
},
{
"name": "cofog1code",
"type": "string"
},
{
"name": "cofog1label",
"type": "string"
},
{
"name": "cofog2code",
"type": "string"
},
{
"name": "cofog2label",
"type": "string"
},
{
"name": "cofog3code",
"type": "string"
},
{
"name": "cofog3label",
"type": "string"
},
{
"name": "programID",
"type": "string"
},
{
"name": "type",
"type": "string"
},
{
"name": "amount",
"type": "float"
},
{
"name": "id",
"type": "string"
},
{
"name": "cofog",
"type": "string"
}
]
}
},
{
"path": "./armenia-approved-2010.csv",
"name": "armenia-approved-2010",
"currency": "AMD",
"dateLastUpdated": "2013-12-17",
"datePublished": "2012-02-13",
"fiscalYear": "2010",
"granularity": "aggregated",
"standard": "prerelease-MayDay",
"status": "approved",
"type": "expenditure",
"schema": {
"primaryKey": "id",
"fields": [
{
"name": "year",
"type": "date"
},
{
"name": "adminID",
"type": "string"
},
{
"name": "admin",
"type": "string"
},
{
"name": "economicID_level1",
"type": "string"
},
{
"name": "economic_level1",
"type": "string"
},
{
"name": "economicID_level2",
"type": "string"
},
{
"name": "economic_level2",
"type": "string"
},
{
"name": "economicID_level3",
"type": "string"
},
{
"name": "economic_level3",
"type": "string"
},
{
"name": "economicID",
"type": "string"
},
{
"name": "economic",
"type": "string"
},
{
"name": "cofog1code",
"type": "string"
},
{
"name": "cofog1label",
"type": "string"
},
{
"name": "cofog2code",
"type": "string"
},
{
"name": "cofog2label",
"type": "string"
},
{
"name": "cofog3code",
"type": "string"
},
{
"name": "cofog3label",
"type": "string"
},
{
"name": "programID",
"type": "string"
},
{
"name": "type",
"type": "string"
},
{
"name": "amount",
"type": "float"
},
{
"name": "id",
"type": "string"
},
{
"name": "cofog",
"type": "string"
}
]
}
},
{
"path": "./armenia-approved-2011.csv",
"name": "armenia-approved-2011",
"currency": "AMD",
"dateLastUpdated": "2013-12-17",
"datePublished": "2012-02-13",
"fiscalYear": "2011",
"granularity": "aggregated",
"standard": "prerelease-MayDay",
"status": "approved",
"type": "expenditure",
"schema": {
"primaryKey": "id",
"fields": [
{
"name": "year",
"type": "date"
},
{
"name": "adminID",
"type": "string"
},
{
"name": "admin",
"type": "string"
},
{
"name": "economicID_level1",
"type": "string"
},
{
"name": "economic_level1",
"type": "string"
},
{
"name": "economicID_level2",
"type": "string"
},
{
"name": "economic_level2",
"type": "string"
},
{
"name": "economicID_level3",
"type": "string"
},
{
"name": "economic_level3",
"type": "string"
},
{
"name": "economicID",
"type": "string"
},
{
"name": "economic",
"type": "string"
},
{
"name": "cofog1code",
"type": "string"
},
{
"name": "cofog1label",
"type": "string"
},
{
"name": "cofog2code",
"type": "string"
},
{
"name": "cofog2label",
"type": "string"
},
{
"name": "cofog3code",
"type": "string"
},
{
"name": "cofog3label",
"type": "string"
},
{
"name": "programID",
"type": "string"
},
{
"name": "type",
"type": "string"
},
{
"name": "amount",
"type": "float"
},
{
"name": "id",
"type": "string"
},
{
"name": "cofog",
"type": "string"
}
]
}
},
{
"path": "./armenia-approved-2012.csv",
"name": "armenia-approved-2012",
"currency": "AMD",
"dateLastUpdated": "2013-12-17",
"datePublished": "2012-02-13",
"fiscalYear": "2012",
"granularity": "aggregated",
"standard": "prerelease-MayDay",
"status": "approved",
"type": "expenditure",
"schema": {
"primaryKey": "id",
"fields": [
{
"name": "year",
"type": "date"
},
{
"name": "adminID",
"type": "string"
},
{
"name": "admin",
"type": "string"
},
{
"name": "economicID_level1",
"type": "string"
},
{
"name": "economic_level1",
"type": "string"
},
{
"name": "economicID_level2",
"type": "string"
},
{
"name": "economic_level2",
"type": "string"
},
{
"name": "economicID_level3",
"type": "string"
},
{
"name": "economic_level3",
"type": "string"
},
{
"name": "economicID",
"type": "string"
},
{
"name": "economic",
"type": "string"
},
{
"name": "cofog1code",
"type": "string"
},
{
"name": "cofog1label",
"type": "string"
},
{
"name": "cofog2code",
"type": "string"
},
{
"name": "cofog2label",
"type": "string"
},
{
"name": "cofog3code",
"type": "string"
},
{
"name": "cofog3label",
"type": "string"
},
{
"name": "programID",
"type": "string"
},
{
"name": "type",
"type": "string"
},
{
"name": "amount",
"type": "float"
},
{
"name": "id",
"type": "string"
},
{
"name": "cofog",
"type": "string"
}
]
}
},
{
"path": "./armenia-adjusted-2006.csv",
"name": "armenia-adjusted-2006",
"currency": "AMD",
"dateLastUpdated": "2013-12-17",
"datePublished": "2012-02-13",
"fiscalYear": "2006",
"granularity": "aggregated",
"standard": "prerelease-MayDay",
"status": "adjusted",
"type": "expenditure",
"schema": {
"primaryKey": "id",
"fields": [
{
"name": "year",
"type": "date"
},
{
"name": "adminID",
"type": "string"
},
{
"name": "admin",
"type": "string"
},
{
"name": "economicID_level1",
"type": "string"
},
{
"name": "economic_level1",
"type": "string"
},
{
"name": "economicID_level2",
"type": "string"
},
{
"name": "economic_level2",
"type": "string"
},
{
"name": "economicID_level3",
"type": "string"
},
{
"name": "economic_level3",
"type": "string"
},
{
"name": "economicID",
"type": "string"
},
{
"name": "economic",
"type": "string"
},
{
"name": "cofog1code",
"type": "string"
},
{
"name": "cofog1label",
"type": "string"
},
{
"name": "cofog2code",
"type": "string"
},
{
"name": "cofog2label",
"type": "string"
},
{
"name": "cofog3code",
"type": "string"
},
{
"name": "cofog3label",
"type": "string"
},
{
"name": "programID",
"type": "string"
},
{
"name": "type",
"type": "string"
},
{
"name": "amount",
"type": "float"
},
{
"name": "id",
"type": "string"
},
{
"name": "cofog",
"type": "string"
}
]
}
},
{
"path": "./armenia-adjusted-2007.csv",
"name": "armenia-adjusted-2007",
"currency": "AMD",
"dateLastUpdated": "2013-12-17",
"datePublished": "2012-02-13",
"fiscalYear": "2007",
"granularity": "aggregated",
"standard": "prerelease-MayDay",
"status": "adjusted",
"type": "expenditure",
"schema": {
"primaryKey": "id",
"fields": [
{
"name": "year",
"type": "date"
},
{
"name": "adminID",
"type": "string"
},
{
"name": "admin",
"type": "string"
},
{
"name": "economicID_level1",
"type": "string"
},
{
"name": "economic_level1",
"type": "string"
},
{
"name": "economicID_level2",
"type": "string"
},
{
"name": "economic_level2",
"type": "string"
},
{
"name": "economicID_level3",
"type": "string"
},
{
"name": "economic_level3",
"type": "string"
},
{
"name": "economicID",
"type": "string"
},
{
"name": "economic",
"type": "string"
},
{
"name": "cofog1code",
"type": "string"
},
{
"name": "cofog1label",
"type": "string"
},
{
"name": "cofog2code",
"type": "string"
},
{
"name": "cofog2label",
"type": "string"
},
{
"name": "cofog3code",
"type": "string"
},
{
"name": "cofog3label",
"type": "string"
},
{
"name": "programID",
"type": "string"
},
{
"name": "type",
"type": "string"
},
{
"name": "amount",
"type": "float"
},
{
"name": "id",
"type": "string"
},
{
"name": "cofog",
"type": "string"
}
]
}
},
{
"path": "./armenia-adjusted-2008.csv",
"name": "armenia-adjusted-2008",
"currency": "AMD",
"dateLastUpdated": "2013-12-17",
"datePublished": "2012-02-13",
"fiscalYear": "2008",
"granularity": "aggregated",
"standard": "prerelease-MayDay",
"status": "adjusted",
"type": "expenditure",
"schema": {
"primaryKey": "id",
"fields": [
{
"name": "year",
"type": "date"
},
{
"name": "adminID",
"type": "string"
},
{
"name": "admin",
"type": "string"
},
{
"name": "economicID_level1",
"type": "string"
},
{
"name": "economic_level1",
"type": "string"
},
{
"name": "economicID_level2",
"type": "string"
},
{
"name": "economic_level2",
"type": "string"
},
{
"name": "economicID_level3",
"type": "string"
},
{
"name": "economic_level3",
"type": "string"
},
{
"name": "economicID",
"type": "string"
},
{
"name": "economic",
"type": "string"
},
{
"name": "cofog1code",
"type": "string"
},
{
"name": "cofog1label",
"type": "string"
},
{
"name": "cofog2code",
"type": "string"
},
{
"name": "cofog2label",
"type": "string"
},
{
"name": "cofog3code",
"type": "string"
},
{
"name": "cofog3label",
"type": "string"
},
{
"name": "programID",
"type": "string"
},
{
"name": "type",
"type": "string"
},
{
"name": "amount",
"type": "float"
},
{
"name": "id",
"type": "string"
},
{
"name": "cofog",
"type": "string"
}
]
}
},
{
"path": "./armenia-adjusted-2009.csv",
"name": "armenia-adjusted-2009",
"currency": "AMD",
"dateLastUpdated": "2013-12-17",
"datePublished": "2012-02-13",
"fiscalYear": "2009",
"granularity": "aggregated",
"standard": "prerelease-MayDay",
"status": "adjusted",
"type": "expenditure",
"schema": {
"primaryKey": "id",
"fields": [
{
"name": "year",
"type": "date"
},
{
"name": "adminID",
"type": "string"
},
{
"name": "admin",
"type": "string"
},
{
"name": "economicID_level1",
"type": "string"
},
{
"name": "economic_level1",
"type": "string"
},
{
"name": "economicID_level2",
"type": "string"
},
{
"name": "economic_level2",
"type": "string"
},
{
"name": "economicID_level3",
"type": "string"
},
{
"name": "economic_level3",
"type": "string"
},
{
"name": "economicID",
"type": "string"
},
{
"name": "economic",
"type": "string"
},
{
"name": "cofog1code",
"type": "string"
},
{
"name": "cofog1label",
"type": "string"
},
{
"name": "cofog2code",
"type": "string"
},
{
"name": "cofog2label",
"type": "string"
},
{
"name": "cofog3code",
"type": "string"
},
{
"name": "cofog3label",
"type": "string"
},
{
"name": "programID",
"type": "string"
},
{
"name": "type",
"type": "string"
},
{
"name": "amount",
"type": "float"
},
{
"name": "id",
"type": "string"
},
{
"name": "cofog",
"type": "string"
}
]
}
},
{
"path": "./armenia-adjusted-2010.csv",
"name": "armenia-adjusted-2010",
"currency": "AMD",
"dateLastUpdated": "2013-12-17",
"datePublished": "2012-02-13",
"fiscalYear": "2010",
"granularity": "aggregated",
"standard": "prerelease-MayDay",
"status": "adjusted",
"type": "expenditure",
"schema": {
"primaryKey": "id",
"fields": [
{
"name": "year",
"type": "date"
},
{
"name": "adminID",
"type": "string"
},
{
"name": "admin",
"type": "string"
},
{
"name": "economicID_level1",
"type": "string"
},
{
"name": "economic_level1",
"type": "string"
},
{
"name": "economicID_level2",
"type": "string"
},
{
"name": "economic_level2",
"type": "string"
},
{
"name": "economicID_level3",
"type": "string"
},
{
"name": "economic_level3",
"type": "string"
},
{
"name": "economicID",
"type": "string"
},
{
"name": "economic",
"type": "string"
},
{
"name": "cofog1code",
"type": "string"
},
{
"name": "cofog1label",
"type": "string"
},
{
"name": "cofog2code",
"type": "string"
},
{
"name": "cofog2label",
"type": "string"
},
{
"name": "cofog3code",
"type": "string"
},
{
"name": "cofog3label",
"type": "string"
},
{
"name": "programID",
"type": "string"
},
{
"name": "type",
"type": "string"
},
{
"name": "amount",
"type": "float"
},
{
"name": "id",
"type": "string"
},
{
"name": "cofog",
"type": "string"
}
]
}
},
{
"path": "./armenia-adjusted-2011.csv",
"name": "armenia-adjusted-2011",
"currency": "AMD",
"dateLastUpdated": "2013-12-17",
"datePublished": "2012-02-13",
"fiscalYear": "2011",
"granularity": "aggregated",
"standard": "prerelease-MayDay",
"status": "adjusted",
"type": "expenditure",
"schema": {
"primaryKey": "id",
"fields": [
{
"name": "year",
"type": "date"
},
{
"name": "adminID",
"type": "string"
},
{
"name": "admin",
"type": "string"
},
{
"name": "economicID_level1",
"type": "string"
},
{
"name": "economic_level1",
"type": "string"
},
{
"name": "economicID_level2",
"type": "string"
},
{
"name": "economic_level2",
"type": "string"
},
{
"name": "economicID_level3",
"type": "string"
},
{
"name": "economic_level3",
"type": "string"
},
{
"name": "economicID",
"type": "string"
},
{
"name": "economic",
"type": "string"
},
{
"name": "cofog1code",
"type": "string"
},
{
"name": "cofog1label",
"type": "string"
},
{
"name": "cofog2code",
"type": "string"
},
{
"name": "cofog2label",
"type": "string"
},
{
"name": "cofog3code",
"type": "string"
},
{
"name": "cofog3label",
"type": "string"
},
{
"name": "programID",
"type": "string"
},
{
"name": "type",
"type": "string"
},
{
"name": "amount",
"type": "float"
},
{
"name": "id",
"type": "string"
},
{
"name": "cofog",
"type": "string"
}
]
}
},
{
"path": "./armenia-adjusted-2012.csv",
"name": "armenia-adjusted-2012",
"currency": "AMD",
"dateLastUpdated": "2013-12-17",
"datePublished": "2012-02-13",
"fiscalYear": "2012",
"granularity": "aggregated",
"standard": "prerelease-MayDay",
"status": "adjusted",
"type": "expenditure",
"schema": {
"primaryKey": "id",
"fields": [
{
"name": "year",
"type": "date"
},
{
"name": "adminID",
"type": "string"
},
{
"name": "admin",
"type": "string"
},
{
"name": "economicID_level1",
"type": "string"
},
{
"name": "economic_level1",
"type": "string"
},
{
"name": "economicID_level2",
"type": "string"
},
{
"name": "economic_level2",
"type": "string"
},
{
"name": "economicID_level3",
"type": "string"
},
{
"name": "economic_level3",
"type": "string"
},
{
"name": "economicID",
"type": "string"
},
{
"name": "economic",
"type": "string"
},
{
"name": "cofog1code",
"type": "string"
},
{
"name": "cofog1label",
"type": "string"
},
{
"name": "cofog2code",
"type": "string"
},
{
"name": "cofog2label",
"type": "string"
},
{
"name": "cofog3code",
"type": "string"
},
{
"name": "cofog3label",
"type": "string"
},
{
"name": "programID",
"type": "string"
},
{
"name": "type",
"type": "string"
},
{
"name": "amount",
"type": "float"
},
{
"name": "id",
"type": "string"
},
{
"name": "cofog",
"type": "string"
}
]
}
},
{
"path": "./armenia-executed-2006.csv",
"name": "armenia-executed-2006",
"currency": "AMD",
"dateLastUpdated": "2013-12-17",
"datePublished": "2012-02-13",
"fiscalYear": "2006",
"granularity": "aggregated",
"standard": "prerelease-MayDay",
"status": "executed",
"type": "expenditure",
"schema": {
"primaryKey": "id",
"fields": [
{
"name": "year",
"type": "date"
},
{
"name": "adminID",
"type": "string"
},
{
"name": "admin",
"type": "string"
},
{
"name": "economicID_level1",
"type": "string"
},
{
"name": "economic_level1",
"type": "string"
},
{
"name": "economicID_level2",
"type": "string"
},
{
"name": "economic_level2",
"type": "string"
},
{
"name": "economicID_level3",
"type": "string"
},
{
"name": "economic_level3",
"type": "string"
},
{
"name": "economicID",
"type": "string"
},
{
"name": "economic",
"type": "string"
},
{
"name": "cofog1code",
"type": "string"
},
{
"name": "cofog1label",
"type": "string"
},
{
"name": "cofog2code",
"type": "string"
},
{
"name": "cofog2label",
"type": "string"
},
{
"name": "cofog3code",
"type": "string"
},
{
"name": "cofog3label",
"type": "string"
},
{
"name": "programID",
"type": "string"
},
{
"name": "type",
"type": "string"
},
{
"name": "amount",
"type": "float"
},
{
"name": "id",
"type": "string"
},
{
"name": "cofog",
"type": "string"
}
]
}
},
{
"path": "./armenia-executed-2007.csv",
"name": "armenia-executed-2007",
"currency": "AMD",
"dateLastUpdated": "2013-12-17",
"datePublished": "2012-02-13",
"fiscalYear": "2007",
"granularity": "aggregated",
"standard": "prerelease-MayDay",
"status": "executed",
"type": "expenditure",
"schema": {
"primaryKey": "id",
"fields": [
{
"name": "year",
"type": "date"
},
{
"name": "adminID",
"type": "string"
},
{
"name": "admin",
"type": "string"
},
{
"name": "economicID_level1",
"type": "string"
},
{
"name": "economic_level1",
"type": "string"
},
{
"name": "economicID_level2",
"type": "string"
},
{
"name": "economic_level2",
"type": "string"
},
{
"name": "economicID_level3",
"type": "string"
},
{
"name": "economic_level3",
"type": "string"
},
{
"name": "economicID",
"type": "string"
},
{
"name": "economic",
"type": "string"
},
{
"name": "cofog1code",
"type": "string"
},
{
"name": "cofog1label",
"type": "string"
},
{
"name": "cofog2code",
"type": "string"
},
{
"name": "cofog2label",
"type": "string"
},
{
"name": "cofog3code",
"type": "string"
},
{
"name": "cofog3label",
"type": "string"
},
{
"name": "programID",
"type": "string"
},
{
"name": "type",
"type": "string"
},
{
"name": "amount",
"type": "float"
},
{
"name": "id",
"type": "string"
},
{
"name": "cofog",
"type": "string"
}
]
}
},
{
"path": "./armenia-executed-2008.csv",
"name": "armenia-executed-2008",
"currency": "AMD",
"dateLastUpdated": "2013-12-17",
"datePublished": "2012-02-13",
"fiscalYear": "2008",
"granularity": "aggregated",
"standard": "prerelease-MayDay",
"status": "executed",
"type": "expenditure",
"schema": {
"primaryKey": "id",
"fields": [
{
"name": "year",
"type": "date"
},
{
"name": "adminID",
"type": "string"
},
{
"name": "admin",
"type": "string"
},
{
"name": "economicID_level1",
"type": "string"
},
{
"name": "economic_level1",
"type": "string"
},
{
"name": "economicID_level2",
"type": "string"
},
{
"name": "economic_level2",
"type": "string"
},
{
"name": "economicID_level3",
"type": "string"
},
{
"name": "economic_level3",
"type": "string"
},
{
"name": "economicID",
"type": "string"
},
{
"name": "economic",
"type": "string"
},
{
"name": "cofog1code",
"type": "string"
},
{
"name": "cofog1label",
"type": "string"
},
{
"name": "cofog2code",
"type": "string"
},
{
"name": "cofog2label",
"type": "string"
},
{
"name": "cofog3code",
"type": "string"
},
{
"name": "cofog3label",
"type": "string"
},
{
"name": "programID",
"type": "string"
},
{
"name": "type",
"type": "string"
},
{
"name": "amount",
"type": "float"
},
{
"name": "id",
"type": "string"
},
{
"name": "cofog",
"type": "string"
}
]
}
},
{
"path": "./armenia-executed-2009.csv",
"name": "armenia-executed-2009",
"currency": "AMD",
"dateLastUpdated": "2013-12-17",
"datePublished": "2012-02-13",
"fiscalYear": "2009",
"granularity": "aggregated",
"standard": "prerelease-MayDay",
"status": "executed",
"type": "expenditure",
"schema": {
"primaryKey": "id",
"fields": [
{
"name": "year",
"type": "date"
},
{
"name": "adminID",
"type": "string"
},
{
"name": "admin",
"type": "string"
},
{
"name": "economicID_level1",
"type": "string"
},
{
"name": "economic_level1",
"type": "string"
},
{
"name": "economicID_level2",
"type": "string"
},
{
"name": "economic_level2",
"type": "string"
},
{
"name": "economicID_level3",
"type": "string"
},
{
"name": "economic_level3",
"type": "string"
},
{
"name": "economicID",
"type": "string"
},
{
"name": "economic",
"type": "string"
},
{
"name": "cofog1code",
"type": "string"
},
{
"name": "cofog1label",
"type": "string"
},
{
"name": "cofog2code",
"type": "string"
},
{
"name": "cofog2label",
"type": "string"
},
{
"name": "cofog3code",
"type": "string"
},
{
"name": "cofog3label",
"type": "string"
},
{
"name": "programID",
"type": "string"
},
{
"name": "type",
"type": "string"
},
{
"name": "amount",
"type": "float"
},
{
"name": "id",
"type": "string"
},
{
"name": "cofog",
"type": "string"
}
]
}
},
{
"path": "./armenia-executed-2010.csv",
"name": "armenia-executed-2010",
"currency": "AMD",
"dateLastUpdated": "2013-12-17",
"datePublished": "2012-02-13",
"fiscalYear": "2010",
"granularity": "aggregated",
"standard": "prerelease-MayDay",
"status": "executed",
"type": "expenditure",
"schema": {
"primaryKey": "id",
"fields": [
{
"name": "year",
"type": "date"
},
{
"name": "adminID",
"type": "string"
},
{
"name": "admin",
"type": "string"
},
{
"name": "economicID_level1",
"type": "string"
},
{
"name": "economic_level1",
"type": "string"
},
{
"name": "economicID_level2",
"type": "string"
},
{
"name": "economic_level2",
"type": "string"
},
{
"name": "economicID_level3",
"type": "string"
},
{
"name": "economic_level3",
"type": "string"
},
{
"name": "economicID",
"type": "string"
},
{
"name": "economic",
"type": "string"
},
{
"name": "cofog1code",
"type": "string"
},
{
"name": "cofog1label",
"type": "string"
},
{
"name": "cofog2code",
"type": "string"
},
{
"name": "cofog2label",
"type": "string"
},
{
"name": "cofog3code",
"type": "string"
},
{
"name": "cofog3label",
"type": "string"
},
{
"name": "programID",
"type": "string"
},
{
"name": "type",
"type": "string"
},
{
"name": "amount",
"type": "float"
},
{
"name": "id",
"type": "string"
},
{
"name": "cofog",
"type": "string"
}
]
}
},
{
"path": "./armenia-executed-2011.csv",
"name": "armenia-executed-2011",
"currency": "AMD",
"dateLastUpdated": "2013-12-17",
"datePublished": "2012-02-13",
"fiscalYear": "2011",
"granularity": "aggregated",
"standard": "prerelease-MayDay",
"status": "executed",
"type": "expenditure",
"schema": {
"primaryKey": "id",
"fields": [
{
"name": "year",
"type": "date"
},
{
"name": "adminID",
"type": "string"
},
{
"name": "admin",
"type": "string"
},
{
"name": "economicID_level1",
"type": "string"
},
{
"name": "economic_level1",
"type": "string"
},
{
"name": "economicID_level2",
"type": "string"
},
{
"name": "economic_level2",
"type": "string"
},
{
"name": "economicID_level3",
"type": "string"
},
{
"name": "economic_level3",
"type": "string"
},
{
"name": "economicID",
"type": "string"
},
{
"name": "economic",
"type": "string"
},
{
"name": "cofog1code",
"type": "string"
},
{
"name": "cofog1label",
"type": "string"
},
{
"name": "cofog2code",
"type": "string"
},
{
"name": "cofog2label",
"type": "string"
},
{
"name": "cofog3code",
"type": "string"
},
{
"name": "cofog3label",
"type": "string"
},
{
"name": "programID",
"type": "string"
},
{
"name": "type",
"type": "string"
},
{
"name": "amount",
"type": "float"
},
{
"name": "id",
"type": "string"
},
{
"name": "cofog",
"type": "string"
}
]
}
},
{
"path": "./armenia-executed-2012.csv",
"name": "armenia-executed-2012",
"currency": "AMD",
"dateLastUpdated": "2013-12-17",
"datePublished": "2012-02-13",
"fiscalYear": "2012",
"granularity": "aggregated",
"standard": "prerelease-MayDay",
"status": "executed",
"type": "expenditure",
"schema": {
"primaryKey": "id",
"fields": [
{
"name": "year",
"type": "date"
},
{
"name": "adminID",
"type": "string"
},
{
"name": "admin",
"type": "string"
},
{
"name": "economicID_level1",
"type": "string"
},
{
"name": "economic_level1",
"type": "string"
},
{
"name": "economicID_level2",
"type": "string"
},
{
"name": "economic_level2",
"type": "string"
},
{
"name": "economicID_level3",
"type": "string"
},
{
"name": "economic_level3",
"type": "string"
},
{
"name": "economicID",
"type": "string"
},
{
"name": "economic",
"type": "string"
},
{
"name": "cofog1code",
"type": "string"
},
{
"name": "cofog1label",
"type": "string"
},
{
"name": "cofog2code",
"type": "string"
},
{
"name": "cofog2label",
"type": "string"
},
{
"name": "cofog3code",
"type": "string"
},
{
"name": "cofog3label",
"type": "string"
},
{
"name": "programID",
"type": "string"
},
{
"name": "type",
"type": "string"
},
{
"name": "amount",
"type": "float"
},
{
"name": "id",
"type": "string"
},
{
"name": "cofog",
"type": "string"
}
]
}
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment