This repository has been archived by the owner. It is now read-only.
No description, website, or topics provided.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.

Sanctuary Cities

What is this?

This project began as a much more expansive analysis, captured on the many messy branches that still exist. The current form exists only to calculate a few numbers for an NPR story on U.S. citizens detained by U.S. Immigration and Customs Enforcement (ICE).

This codebase is licensed under the MIT open source license. See the LICENSE file for the complete license.

The data contained in the data and processed directories were obtained via Freedom of Information Act (FOIA) requests to ICE and is, to the best of our knowledge, in the public domain.

There are two datasets in the data directory:

  • One is a series of files that compromise all detainers issued to local law enforcement agencies from Oct 1, 2007 to July 19, 2015 and their outcome. In the final database, null lift_reason columns are cases that are still pending or for which no paper was filed with ICE. The files belonging to this dataset have filenames that currently begin with FY.
  • The other was obtained via FOIA by Jacqueline Stevens from Northwestern University. The file represents all cases of ICE detention where the detainee claimed U.S. citizenship and includes cases completed between 2008 and 2013. The data includes some manual processing from graduate students to string together sequential outcomes for all cases (as the final outcome of many cases is not the initial ruling).


  • bash
  • Python 2.7 (not tested on Python 3.x)
  • Postgresql


We use virtualenv and virtualenv-wrapper to handle dependencies. See our development installation guide.

mkvirtualenv sanctuary-cities
pip install -r requirements.txt

One shot operation


Individual scripts

  • Clean source data and exported to processed directory.
  • Run the counter queries, U.S. citizens in ICE custody and U.S. citizens issued detainers while in local law enforcement agency custody.
  • Count detentions of U.S. citizens in ICE custody.
  • Put the law enforcement agency data into a Postgresql database.