Skip to content

Instantly share code, notes, and snippets.

View mattdahl's full-sized avatar

Matt Dahl mattdahl

View GitHub Profile
from courts_db import courts
# Get all citation strings
court_strings = [c['citation_string'] for c in courts if c['citation_string'] != '']
# How many existing collisions are there?
len(court_strings) - len(set(court_strings)) # Returns 148
# Remove the existing collisions
court_strings = list(set(court_strings))
@mattdahl
mattdahl / merge_court_db_data.js
Created January 7, 2021 05:05
Code for joining the courts_db data with CL's citation_string data.
const fs = require('fs')
const request = require('request');
// get courts in courts_db
const our_courts = JSON.parse(fs.readFileSync('courts_db/data/courts_old.json', 'utf8'));
console.log(our_courts.length);
// get courts in CL
let their_courts = [];
const get_their_courts = function (url) {