Skip to content

Instantly share code, notes, and snippets.


James McKinney jpmckinney

View GitHub Profile
# Generates:
# Gist:
# GitHub:
# CRM:
import csv
import json
jpmckinney /
Last active Nov 30, 2019
Compare differences after making changes to Sphinx

Written as part of

curl -O
diff -rq build t | grep Only | sort
diff -ru -x '*.js' -x '.buildinfo' -x '_sources' build t | less
View framework-agreement-tmp-paraguay.json
"tender": {
"title": "Adquisición de Útiles de Oficina",
"id": "355477-adquisicion-utiles-oficina",
"procuringEntity": {
"id": "50",
"name": "Dirección Nacional de Contrataciones Públicas (DNCP)"
"procurementMethod": "open",
"procurementMethodDetails": "Licitación Pública Nacional",
jpmckinney /
Created Jul 20, 2019
Test the performance of approaches to flattening JSON to CSV.

Building a dict by reference is faster than recursively building a dict (slowest) or list of tuples.


return {key: obj}
d = {}
import gettext
import os
import re
import sys
from collections import OrderedDict
from docutils import frontend
from docutils import nodes
from docutils.parsers import rst
from docutils.utils import new_document
jpmckinney / character-class.rb
Created Feb 14, 2017
Character class to match encoding errors
View character-class.rb
jpmckinney /
Last active Jan 31, 2017
Online and informal intergovernmental networks

Slack communities

jpmckinney /
Last active Feb 3, 2017
Languages used by government GitHub repositories

These files list government GitHub repositories, and the number of bytes of code written in each language.

Produced by running the languages:github Rake task from open_source_canada against the list of 'U.S. City' and 'U.S. Federal' GitHub organizations. Data for Canadian GitHub organizations is elsewhere.

jpmckinney / index.html
Last active Jul 16, 2016
Side-by-side comparison of draft versus final Canada OGP National Action Plan 2016-18.
View index.html
<!DOCTYPE html>
<meta charset="utf-8">
width: 50%;
float: left;
font: 300 16px/23px Helvetica,Arial,sans-serif;
del, .del
View dataportal.json
"language": "en",
"title": "Paris Data",
"description": "City of Paris Open Data portal",
"homepage": "",
"modified": "2016-03-04T13:44:44+00:00",
"conformsTo": "",
"number_of_datasets": 176,
"name": "City of Paris",