README is empty
README is empty
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
'''Run this script and it will export a list of all CKAN extensions on github | |
(guessed by repo name containing ckanext) to json and csv files in in this directory | |
''' | |
import urllib | |
import json | |
import csv | |
jsonfp = 'extensions-gh.json' | |
csvfp = 'extensions-gh.csv' |
HDX Common Humanitarian Dataset data into CKAN instance (we used datahub.io for convenience).
http://datahub.io/dataset/hdx-common-humanitarian-dataset
We've loaded (indicator) value table and indicator table separately in the CKAN DataStore (we have not bothered loading dataset table for the present) and we've also created a python script to automate this (which can also serve as an example of how to work with CKAN API).
Setting this up was pretty fast (most of the work was actually tidying up the data and then making some scripts to make this repeatable and testable).
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
// replace this with your CKAN website | |
var ckanSite = 'http://datahub.io' | |
var sql = 'Your SQL goes here'; | |
// ================= | |
// Using jQuery only | |
// ================= | |
var data = encodeURIComponent(JSON.stringify({sql: sql})); |
We can make this file beautiful and searchable if this error is corrected: It looks like row 4 should actually have 17 columns, instead of 10. in line 3.
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
year,admin1,admin2,admin3,admin4,admin5,admin6,func1,func2,econ1,econ2,fin_source,exp_type,transfer,approved,adjusted,executed | |
2009,Central,101 Parliament,0101 Parliament,,,010 Central apparatus (office) of ministries and other administrative authorities,01 General purpose state services,01.01 Legislative authorities,111 Remuneration of work,111.00 Remuneration of work,Base component,Personnel,Excluding transfers,30269300,30269300,27849186 | |
2009,Central,101 Parliament,0101 Parliament,,,010 Central apparatus (office) of ministries and other administrative authorities,01 General purpose state services,01.01 Legislative authorities,112 Mandatory state social insurance premiums,112.00 Mandatory state social insurance premiums,Base component,Personnel,Excluding transfers,5564000,5564000,5401021 | |
2009,Central,101 Parliament,0101 Parliament,,,010 Central apparatus (office) of ministries and other administrative authorities,01 General purpose state services,01.01 Legislative authorities,113 Payment for goods and servic |
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 ckanclient | |
base_location = 'http://localhost:5000/api' | |
api_key = 'tester' | |
client = ckanclient.CkanClient(base_location, api_key) | |
pkg = dict( | |
name='test-ckanext-datapreview', | |
title='Test CKANext Data Preview', | |
resources=[ | |
dict( |
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
# Get user stories out a spreadsheet and into mediawiki syntax | |
# | |
# Designed for this set here | |
# https://docs.google.com/spreadsheet/ccc?key=0Aon3JiuouxLUdFhMVEVFWXhxWXRKaU04LUF2ZTVsTVE&hl=en_GB#gid=0 | |
# Pass it link to gdocs csv as argument on command line | |
# E.g. | |
# | |
# python userstories.py "https://docs.google.com/spreadsheet/pub?hl=en_GB&hl=en_GB&key=0Aon3JiuouxLUdFhMVEVFWXhxWXRKaU04LUF2ZTVsTVE&single=true&gid=0&output=csv" | |
# | |
import urllib |
OlderNewer