Skip to content

Instantly share code, notes, and snippets.

View asg017's full-sized avatar

Alex Garcia asg017

View GitHub Profile
@asg017
asg017 / pyproject.toml
Last active July 22, 2023 22:45 — forked from simonw/pyproject.toml
sqlite-utils hello world plugin
[project]
name = "sqlite-utils-hello-world"
version = "0.2"
[project.entry-points.sqlite_utils]
hello_world = "sqlite_utils_hello_world"
@asg017
asg017 / README.md
Last active November 24, 2020 03:46
unitedstates/congress-legislators -> SQLite DB for Datasette

unitedstates/congress-legislators -> SQLite DB for Datasette

Python script that converts the JSON files at https://github.com/unitedstates/congress-legislators into a SQLite database. No extra deps required, just python3!

To run the script, download the legislators-current and legislators-historical JSON files from the unitedstates/congress-legislators repo, then run:

python3 legislators_to_db.py legislators-historical.json legislators-current.json congress-members.db
We can't make this file beautiful and searchable because it's too large.
STOP_FRISK_ID,STOP_FRISK_DATE,STOP_FRISK_TIME,YEAR2,MONTH2,DAY2,STOP_WAS_INITIATED,SPRINT_NUMBER,RECORD_STATUS_CODE,ISSUING_OFFICER_RANK,ISSUING_OFFICER_COMMAND_CODE,SUPERVISING_OFFICER_RANK,SUPERVISING_OFFICER_COMMAND_CODE,SUPERVISING_ACTION_CORRESPONDING_ACTIVITY_LOG_ENTRY_REVIEWED,LOCATION_IN_OUT_CODE,JURISDICTION_CODE,JURISDICTION_DESCRIPTION,OBSERVED_DURATION_MINUTES,SUSPECTED_CRIME_DESCRIPTION,STOP_DURATION_MINUTES,OFFICER_EXPLAINED_STOP_FLAG,OFFICER_NOT_EXPLAINED_STOP_DESCRIPTION,OTHER_PERSON_STOPPED_FLAG,SUSPECT_ARRESTED_FLAG,SUSPECT_ARREST_NUMBER,SUSPECT_ARREST_OFFENSE,SUMMONS_ISSUED_FLAG,SUMMONS_NUMBER,SUMMONS_OFFENSE_DESCRIPTION,OFFICER_IN_UNIFORM_FLAG,ID_CARD_IDENTIFIES_OFFICER_FLAG,SHIELD_IDENTIFIES_OFFICER_FLAG,VERBAL_IDENTIFIES_OFFICER_FLAG,FRISKED_FLAG,SEARCHED_FLAG,OTHER_CONTRABAND_FLAG,FIREARM_FLAG,KNIFE_CUTTER_FLAG,OTHER_WEAPON_FLAG,WEAPON_FOUND_FLAG,PHYSICAL_FORCE_CEW_FLAG,PHYSICAL_FORCE_DRAW_POINT_FIREARM_FLAG,PHYSICAL_FORCE_HANDCUFF_SUSPECT_FLAG,PHYSICAL_FORCE_OC_SPRAY_USED_FLAG,PHYSICAL
#!/bin/bash
wget -O ngrok.zip https://bin.equinox.io/c/4VmDzA7iaHb/ngrok-stable-linux-amd64.zip
#sudo apt-get install unzip
unzip ngrok.zip
rm ngrok.zip
mv ngrok ~/ngrok