This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (pypi.python.org).
Help us improve Python packaging - Donate today!

Replace village and commonly-misspelled Connecticut town names with real town names.

Project Description

# CT Name Cleaner

Resolve village and coloquial Connecticut town names, as well as common misspellings of Connecticut town names to their official town names.

This is based on an R package of the same name by my colleague Andrew Ba Tran.

This installs a command line script, ctclean, as well as a library

by Jake Kara, jake@jakekara.com

### Installation

pip install ctnamecleaner

### Command line util

Usage:

$ ctclean NewPreston WASHINGTON $ ctclean “New Preston” WASHINGTON

When nothing is found, return None:

$ ctclean NotGonnaFindItsVille None

Set a custom value to return on error with the –error or -e flag:

$ ctclean NotGonnaFindItsVille –error “Ruh Roh” Ruh Roh

### Use with Pandas dataframes

See the demo/ folder in this repo for an example of translating an entire column with the Lookup.clean_dataframe() method. It uses pandas’ DataFrame.join() method, so it’s faster than using the Lookup.cean() method and applying it with a lambda function yourself.

### Extending with other data

Not in CT? Want to map other things, like population? Just make a spreadsheet and put it anywhere, online or locally, that Pandas .read_csv() can open.

You can specify a spreadsheet (local or remote) to use as the lookup table when you instantiate a Lookup object. You have to specify a path to the sheet as well as the name of the raw name column and the clean name column.

>>> l = lookup.Lookup(csv_url="http://path/to/your/sheet",
                      raw_name_col="something",
                      clean_name_col="something_else")
Release History

Release History

This version
History Node

0.10

History Node

0.9

History Node

0.8

History Node

0.7

History Node

0.6

History Node

0.5

History Node

0.4

History Node

0.3

History Node

0.2

History Node

0.1

Download Files

Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
ctnamecleaner-0.10.tar.gz (8.9 kB) Copy SHA256 Checksum SHA256 Source Sep 2, 2016

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting