Skip to content

Instantly share code, notes, and snippets.

View drkane's full-sized avatar

David Kane drkane

View GitHub Profile
@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 / 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.

<!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 / 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 / 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
@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
Type Entity Company Number OSCAR CPID
Academy Trust Gateway Learning Community 05853746 CAD022
Academy Trust John Henry Newman Catholic College, The 07414011 CAD022
Academy Trust Abbey Multi Academy Trust 07705552 CAD022
Academy Trust Abbey School (Faversham), The 07697086 CAD022
Academy Trust St. Thomas More High School 07696989 CAD022
Academy Trust Peaslake Free School Limited 07925067 CAD022
Academy Trust Peatmoor Community Primary School 08714452 CAD022
Academy Trust Abney Trust 09912859 CAD022
Academy Trust Fulwell Infant School Academy 08277622 CAD022
@drkane
drkane / charity-reregistrations.csv
Created February 9, 2018 15:02
Charities registered in England and Wales that are the result of re-registration of an older charity
Old charity number New charity number
306072 1115974
@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
We can't make this file beautiful and searchable because it's too large.
EmployerName,Address,CompanyNumber,SicCodes,DiffMeanHourlyPercent,DiffMedianHourlyPercent,DiffMeanBonusPercent,DiffMedianBonusPercent,MaleBonusPercent,FemaleBonusPercent,MaleLowerQuartile,FemaleLowerQuartile,MaleLowerMiddleQuartile,FemaleLowerMiddleQuartile,MaleUpperMiddleQuartile,FemaleUpperMiddleQuartile,MaleTopQuartile,FemaleTopQuartile,CompanyLinkToGPGInfo,ResponsiblePerson,EmployerSize,CurrentName,CharityNumber,CharityIncome,OrgType,OrgSubType,PaidMore,FemaleWorkforce
"""Bryanston School"",Incorporated","Bryanston House, Blandford, Dorset, United Kingdom, DT11 0PX",00226143,85310,18.0,28.2,0.0,0.0,0.0,0.0,24.4,75.6,50.8,49.2,49.2,50.8,51.5,48.5,https://www.bryanston.co.uk/employment,Nick McRobb (Bursar and Clerk to the Governors),500 to 999,"""Bryanston School"",Incorporated",306210,23130767.0,Charity,,Men,56.025
"""RED BAND"" CHEMICAL COMPANY, LIMITED","19, Smith's Place, Leith Walk, Edinburgh, EH6 8NU",SC016876,47730,2.3,-2.7,15.0,37.5,15.6,66.7,20.3,79.7,25.4,74.6,10.3,89.7,18.1,81.9,,Philip Galt (Man