Skip to content

Instantly share code, notes, and snippets.

James McKinney jpmckinney

Block or report user

Report or block jpmckinney

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
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
View test.json
{"extensions": [{"category": "parties", "core": false, "description": {"en": "For including extra contact points on each organization. Particularly used when each contact point deals only in a particular language or group of languages."}, "documentation_url": "", "name": {"en": "Additional Contact Points"}, "url": ""}, {"category": "bids", "core": true, "description": {"en": "Allowing bid statistics, and detailed bid information to be represented."}, "documentation_url": "", "name": {"en": "Bid statistics and details"}, "url": ""}, {"category": "ppp", "core": false, "description": {"en": "Adds a budget breakdown array to the budget object to break down a budget by source and period."}, "documentation_url": "https
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",
jpmckinney / .block
Last active Jan 23, 2018
WeWork Place Ville-Marie Mac OS X Printing Instructions
View .block
license: cc-by-4.0
jpmckinney / sso-rails-provider.patch
Last active Feb 16, 2016
See The repo also ran `rails g devise:install`, `rails g devise:views` and `rails g devise User`, which aren't shown in the diff to keep it small.
View sso-rails-provider.patch
diff --git b/Gemfile a/Gemfile
index 257a263..4896a34 100644
--- b/Gemfile
+++ a/Gemfile
@@ -43,4 +43,12 @@ group :development do
# Spring speeds up development by keeping your application running in the background. Read more:
gem 'spring'
+ gem 'pry'
You can’t perform that action at this time.