Add management command for creating Chicago border

The clear way to do this would be to take a union of the community
area shapes and get their boundares.  This is the attempt I took
with the ``export_chicago_geojson`` management command.  This
didn't work.

Instead, I'll extract it from the Census Places shapefile using
the ``chicago_geojson_from_shp`` management command.

Addresses https://github.com/sc3/cook-convictions/issues/66
Add suburbs to analysis

Add a CensusPlace model to represent census places in Illinois.
I did this iteratively, so there are a couple of migrations
reflecting these schema changes.

The 0017 migration didn't create the spatial fields or indexes
for some reason, even though the migration code seemed correct. I
had to create the spatial column and indices by hand, running the
queries reported by:

./manage.py sqlall convictions_data

In our analysis, we're only concerned with suburban Census Places,
so I added a management command, ``flag_chicago_msa_places`` to
set a flag on the model from records in a CSV file,
``data/data/tl_2010_17_place10_chicago_msa.csv``.

I updated the ``geocode_dispositions`` management command to
support geocoding non-Chicago records.

I updated the ``boundarize`` management command and model methods
to also try to detect an address being in a Census Place.

Add a management command for setting conviction places from their
related disposition.

Rename the ``export_ca_geojson`` to be ``export_model_geojson``
and update it's functionality so it can also export GeoJSON for
the census places around Chicago.  Also update the underlying
model, manager and queryset methods to support this.

Add a ``per_capita_convictions()`` aggregate method to the
``CensusPlace`` and ``CommunityArea`` managers and querysets.

Addresses https://github.com/sc3/cook-convictions/issues/77
Aggregate drug query, conviction queryset refactor

Use our custom drug queries instead of the IUCR-based one as they
capture more convictions.  Refactor the main category methods to
use some aggregate Q() objects making it easier to make other
aggregate queries.

Add method to convictions queryset to filter to convictions not
in our other categories.
Update IPython notebook
Export GeoJSON for "holes" in Chicago

Addresses https://github.com/sc3/cook-convictions/issues/99
Add crimes affecting women counts to GeoJSON

Also factor IUCR code groups and queries into a separate module,
``convictions_data.query.iucr``.

Addresses https://github.com/sc3/cook-convictions/issues/87
Add crimes affecting women per capita to annotations

Addresses https://github.com/sc3/cook-convictions/issues/87
Bake convictions by age bucket JSON

Add the logic to create counts by age bucket to the Queryset
instead of having it in a snippet in the IPython notebook.

Add a management command to do the export.

Remove records for those < 18 from our analysis.

Addresses https://github.com/sc3/cook-convictions/issues/86
Updates to IPython notebook

Move some queries to queryset/manager methods.

Look at maximum geographies in terms of sexual assault and
domestic violence.
Minor updates to drug queries

Spell out amphetamine.

Include more versions of certain cannabis charges.
Update labels for drug categories

Instead of "Other Drug" use "Other or Unspecified Drug".  Instead
of "No Drug" use "Enhancement".
Management command for exporting CSV

Create a class, ``AddressAnonymizer`` for anonymizing the addresses.

This leverages datamade's usaddress package, but we have to use
a fork that I created that adds in really basic support for Python 3.

Create a management command ``export_csv`` to output CSV of the
anonymized disposition fields to standard output.

Addresses https://github.com/sc3/cook-convictions/issues/110
Output header row when exporting CSV

Addresses https://github.com/sc3/cook-convictions/issues/110
Use Postgres, document all ETL steps

As we near launch, I wanted to make sure we could rebuild the analysis
database from scratch.  I found insert and update speeds to be slow with
SQLite, my original database choice, so I wanted to try using Postgres
when I rebuild the database.  While it may be possible to update the
code to work better with SQLite, we don't have a lot of time and I'd
likely lose some of the convenient abstractions of the Django ORM layer.

In the process of this, I updated the README so all steps in the
transform/processing pipeline were reflected.

This commit includes updates to make the processing pipeline work with
Postgres.

One of the big differences is that Postgres seems much more picky about
the field lengths of text fields, which is actually great as a way to
find data quirks, but there were a number of updates that needed to
happen to fix data errors.

When parsing city and state fields, return the state abbreviation, not
the value of the state field.

Hack around false positives when looking up states using the ``us``
package.

Update the ``load_dispositions_csv`` management command to insert
records in batches to avoid the process crashing of Postgres generating
an error.

Also, fix shifted columns due to bad CSV quoting when dispositions are
loaded in ``load_dispositions_csv``.

Update the ``create_dispositions`` management command to process the
RawDisposition instances in batches to avoid running out of memory.

Add assertions in the ``Disposition`` methods that load and parse values
from the ``RawDisposition`` fields to make sure things like state or
charge class are of the correct length.

Cleanly handle exceptions when trying to detect IUCR code for a statute.

Fix the name field of the ``CenusPlace`` model so its 100 chars long
instead of 7.  This was a just a typo in the original code.

You'll have to run ``manage.py migrate convictions_data`` to update your
database with this change.

Add missing ``place`` field to the ``CONVICTIONS_IMPORT_FIELDS`` list
when creating convictions from dispositions.

Update extra SQL in IUCR code queries to work with Postgres.  This is
mostly an issue of how things are quoted.

Remove trailing whitespace throughout modified files.

Update age based queries to use Postgres functions to calculate the age.
This likely breaks things in SQLite.  Also remove
``AgeQuerySetMixin.with_ages`` since Postgres doesn't let you use an
alias in the ``WHERE`` clause as the ``WHERE`` clause is evaluated
first.  Instead, we have to include the age expression directly within
the WHERE clause.  The upside of this is that we can now use the count()
method to get the crimes by type instead of having to use len() and
evaluating the queryset.  This query still runs kind of slow, however.
Merge pull request #17 from ghing/master

Management commands for dealing with suburbs, use Postgres, update README with all data processing steps