Skip to content

Instantly share code, notes, and snippets.

View drkane's full-sized avatar

David Kane drkane

View GitHub Profile
<!doctype html>
<html ng-app>
<head>
<title>Estimating confidence intervals for socio-demographic outputs</title>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.2/angular.min.js"></script>
<link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.0.2/css/bootstrap.min.css">
<!--<script src="//netdna.bootstrapcdn.com/bootstrap/3.0.2/js/bootstrap.min.js"></script>-->
</head>
<body ng-controller="MainCtrl">
<div ng-init="setStandardError()" class="container">
@drkane
drkane / register_of_mergers.py
Last active August 29, 2015 14:08
A python script for scraping the Charity Commission register of charities into a database
import xlrd
import datetime, time
import re
import argparse
import MySQLdb as mdb
import mysql_config as msc
import urllib2
def get_date( value, mode ):
try:
@drkane
drkane / la_ecodes.csv
Created July 7, 2015 12:18
CSV list of official UK ONS geography administrative codes mapped to DCLG "ecodes" for England
LAcode geog_LA Ecode
E06000001 Hartlepool E0701
E06000002 Middlesbrough E0702
E06000003 Redcar and Cleveland E0703
E06000004 Stockton-on-Tees E0704
E06000005 Darlington E1301
E06000006 Halton E0601
E06000007 Warrington E0602
E06000008 Blackburn with Darwen E2301
E06000009 Blackpool E2302
@drkane
drkane / companies_house_sic_codes.csv
Created July 13, 2015 15:08
A lookup table from the SIC codes that Companies House publish in their open data project to SIC2007 codes. In some cases older SIC2003 codes have been "forced" into SIC2007 categories, you may not agree with these decisions. http://download.companieshouse.gov.uk/en_output.html
SICcode SICtext Number of Companies SIC2007
111 Grow cereals & other crops 1506
112 Grow vegetables & nursery products 637
113 Grow fruit, nuts, beverage & spice crops 101
121 Farming of cattle, dairy farming 666
122 Farm sheep, goats, horses, etc. 513
123 Farming of swine 136 01.46
124 Farming of poultry 283 01.47
125 Other farming of animals 288
130 Crops combined with animals, mixed farms 801 01.50
@drkane
drkane / simple_help_book.md
Created November 18, 2015 23:03
A book of numbers about groups who help other people

We write a book of numbers about groups who help other people in this country. We use books that these groups write about what they have done that year to find out about them. We want to find numbers that tell us where they got their money from and what they spend it on. It also tells us how many people work for these groups, and how many people work to help people without getting money. When we show these numbers, other people who make choices about how to look after groups that help people use them to make it easier for the groups, and make sure the groups can help people as best as they can.

@drkane
drkane / uk-councils-with-code.csv
Last active October 4, 2016 09:23
A list of UK Councils (ie the name of the actual council, not the area), alongside their official GSS code
code council_name coucil_name_welsh
E06000001 Hartlepool Borough Council
E06000002 Middlesbrough Borough Council
E06000003 Redcar and Cleveland Borough Council
E06000004 Stockton-on-Tees Borough Council
E06000005 Darlington Borough Council
E06000006 Halton Borough Council
E06000007 Warrington Borough Council
E06000008 Blackburn with Darwen Borough Council
E06000009 Blackpool Council
@drkane
drkane / dual-registered-uk-charities.csv
Last active April 3, 2018 09:20
A list of charities which are registered with both the Charity Commission for England and Wales (CCEW) and the Office of the Scottish Charity Regulator (OSCR)
Scottish Charity Number E&W Charity Number Charity Name (E&W)
SC002327 263710 Shelter, National Campaign for Homeless People Limited
SC004252 247556 Sisters Trust
SC005117 218186 Leonard Cheshire Disability
SC008010 227812 Franciscan Missionary Sisters for Africa
SC009359 214779 The Salvation Army
SC009466 227848 Society of the Sacred Heart
SC010315 1084189 British Limbless Ex-Service Men's Association (Blesma)
SC011294 227350 The Congregation of the Holy Spirit and the Immaculate Heart of Mary (British Province)
SC024963 299106 The Central Gifts Committee of the Churches of God
@drkane
drkane / cc-aoo-gss-iso.csv
Last active March 22, 2017 15:03
Charity Commission area of operation codes with GSS and ISO country codes
aootype aookey aooname aoosort welsh master GSS ISO3166-1 ISO3166-2:GB ContinentCode oldCode
A 1 THROUGHOUT ENGLAND AND WALES At least 10 authorities in England and Wales N K04000001 GB GB-EAW EU 941
A 2 THROUGHOUT ENGLAND At least 10 authorities in England only N E92000001 GB GB-ENG EU 921
A 3 THROUGHOUT WALES At least 10 authorities in Wales only N W92000004 GB GB-WLS EU 924
A 4 THROUGHOUT LONDON At least 10 authorities in Greater London N E12000007 GB EU H
B 1 BRACKNELL FOREST BRACKNELL FOREST N E06000036 GB GB-BRC EU 00MA
B 2 WEST BERKSHIRE WEST BERKSHIRE N E06000037 GB GB-WBK EU 00MB
B 3 READING READING N E06000038 GB GB-RDG EU 00MC
B 4 SLOUGH SLOUGH N E06000039 GB GB-SLG EU 00MD
B 5 WINDSOR AND MAIDENHEAD WINDSOR AND MAIDENHEAD N E06000040 GB GB-WNM EU 00ME
@drkane
drkane / part-b-hierarchy.md
Last active May 17, 2020 19:21
Charity Commission Part B fields

extract_partb

Annual Return Detail table. Row for each AR for each registered main charity. Contains a row for each year for each charity, with more detailed financial information. Charities only have to fill in this information if their income is greater than £500,000 in that year.

Field name Data type Description Note
@drkane
drkane / ccew-oscr-activities-readacross.csv
Created March 3, 2017 16:40
Read-across for activity, beneficiary and purpose categories for Charities from those used by the Charity Commission for England and Wales (CCEW) to the Office of the Scottish Charity Regulator (OSCR). NB These are many-to-many relationships, and lots of the categories don't match exactly.
ccew-classno ccew-classtext oscr-group oscr-label
201 CHILDREN/YOUNG PEOPLE beneficiaries Children / young people
202 ELDERLY/OLD PEOPLE beneficiaries Older people
203 PEOPLE WITH DISABILITIES beneficiaries People with disabilities or health problems
204 PEOPLE OF A PARTICULAR ETHNIC OR RACIAL ORIGIN beneficiaries People of a particular ethnic or racial origin
205 OTHER CHARITIES OR VOLUNTARY BODIES beneficiaries Other charities / voluntary bodies
206 OTHER DEFINED GROUPS beneficiaries Other defined groups
207 THE GENERAL PUBLIC/MANKIND beneficiaries No specific group, or for the benefit of the community"
101 GENERAL CHARITABLE PURPOSES purposes Any other purpose that may reasonably be regarded as analogous to any of the preceding purposes
102 EDUCATION/TRAINING purposes The advancement of education