addfips
Advanced tools
@@ -13,4 +13,4 @@ #!/usr/bin/env python | ||
| __version__ = '0.2.0' | ||
| __version__ = '0.2.1' | ||
| __all__ = ['addfips'] |
+21
-6
@@ -47,2 +47,8 @@ # -*- coding: utf-8 -*- | ||
| abbrevs = { | ||
| 'ft. ': 'fort ', | ||
| 'st. ': 'saint ', | ||
| 'ste. ': 'sainte ', | ||
| } | ||
| def __init__(self, vintage=None): | ||
@@ -83,9 +89,16 @@ if vintage is None or vintage not in COUNTY_FILES: | ||
| # Special rule for "St." places | ||
| if re.match(r'st\. ', county): | ||
| saint = county.replace('st.', 'saint', 1) | ||
| bare_saint = bare_county.replace('st.', 'saint', 1) | ||
| state[saint] = state[bare_saint] = row['countyfp'] | ||
| # Add both versions of abbreviated names to the dict. | ||
| for short, full in self.abbrevs.items(): | ||
| needle, replace = None, None | ||
| if county.startswith(short): | ||
| needle, replace = short, full | ||
| elif county.startswith(full): | ||
| needle, replace = full, short | ||
| if needle is not None: | ||
| replaced = county.replace(needle, replace, 1) | ||
| bare_replaced = bare_county.replace(needle, replace, 1) | ||
| state[replaced] = state[bare_replaced] = row['countyfp'] | ||
| def _delete_diacretics(self, string): | ||
@@ -126,3 +139,5 @@ return re.sub(self.diacretic_pattern, self.delete_diacretics, string) | ||
| ''' | ||
| state_field = state_field or self.default_state_field | ||
| if state_field is None: | ||
| state_field = self.default_state_field | ||
| fips = self.get_state_fips(row[state_field]) | ||
@@ -129,0 +144,0 @@ |
+1
-1
| Metadata-Version: 2.0 | ||
| Name: addfips | ||
| Version: 0.2.0 | ||
| Version: 0.2.1 | ||
| Summary: Add county FIPS to tabular data | ||
@@ -5,0 +5,0 @@ Home-page: http://github.com/fitnr/addfips |
+1
-1
@@ -1,1 +0,1 @@ | ||
| {"generator": "bdist_wheel (0.26.0)", "summary": "Add county FIPS to tabular data", "classifiers": ["Development Status :: 4 - Beta", "Intended Audience :: Developers", "License :: OSI Approved :: GNU General Public License v3 (GPLv3)", "Natural Language :: English", "Operating System :: Unix", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: Implementation :: PyPy", "Operating System :: OS Independent"], "extensions": {"python.details": {"project_urls": {"Home": "http://github.com/fitnr/addfips"}, "contacts": [{"email": "contact@fakeisthenewreal.org", "name": "Neil Freeman", "role": "author"}], "document_names": {"description": "DESCRIPTION.rst"}}, "python.exports": {"console_scripts": {"addfips": "addfips.cli:main"}}, "python.commands": {"wrap_console": {"addfips": "addfips.cli:main"}}}, "keywords": ["csv", "census", "usa", "data"], "license": "GPL-3.0", "metadata_version": "2.0", "name": "addfips", "version": "0.2.0"} | ||
| {"generator": "bdist_wheel (0.26.0)", "summary": "Add county FIPS to tabular data", "classifiers": ["Development Status :: 4 - Beta", "Intended Audience :: Developers", "License :: OSI Approved :: GNU General Public License v3 (GPLv3)", "Natural Language :: English", "Operating System :: Unix", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: Implementation :: PyPy", "Operating System :: OS Independent"], "extensions": {"python.details": {"project_urls": {"Home": "http://github.com/fitnr/addfips"}, "contacts": [{"email": "contact@fakeisthenewreal.org", "name": "Neil Freeman", "role": "author"}], "document_names": {"description": "DESCRIPTION.rst"}}, "python.exports": {"console_scripts": {"addfips": "addfips.cli:main"}}, "python.commands": {"wrap_console": {"addfips": "addfips.cli:main"}}}, "keywords": ["csv", "census", "usa", "data"], "license": "GPL-3.0", "metadata_version": "2.0", "name": "addfips", "version": "0.2.1"} |
+9
-9
@@ -1,3 +0,3 @@ | ||
| addfips/__init__.py,sha256=i_-4bRRvgXbkBGFEVeEr48nYG_nz9WeXAyg3gRZs67w,323 | ||
| addfips/addfips.py,sha256=13Isl_aJdbY8KbattAeb3zslL69jg4XXkP_WOpK_nak,5270 | ||
| addfips/__init__.py,sha256=0zgz41RagWIDt2YmO4pY2S7DEpCZaR8kwYef2lvkV1k,323 | ||
| addfips/addfips.py,sha256=Wsb-mVD6GMYxe6NKv9htATRlKxqjGkV9oJjqcR6z8DM,5752 | ||
| addfips/cli.py,sha256=liZG0sG6DPBampzUEmcyMJfIYEv1afCuz8V9vzRUt8E,3532 | ||
@@ -8,8 +8,8 @@ addfips/data/counties_2000.csv,sha256=nIZ3T62dNT7TKvKngt9zmOHbZ65PdkPYNM8T1kXgct0,71612 | ||
| addfips/data/states.csv,sha256=Lg7QLR6lFxQHDyUwH9WBthCFtMPTz7XTWwYFQVZ0_10,1036 | ||
| addfips-0.2.0.dist-info/DESCRIPTION.rst,sha256=Ckgbsc4VJe8GHsRBvMjRVB3CggGf8v1G6XP9c669WJI,7591 | ||
| addfips-0.2.0.dist-info/METADATA,sha256=IPWcK2Sm2b6Dvtxe_IoinV8bhrOubvpyk9C9XBkH2D0,8363 | ||
| addfips-0.2.0.dist-info/RECORD,, | ||
| addfips-0.2.0.dist-info/WHEEL,sha256=GrqQvamwgBV4nLoJe0vhYRSWzWsx7xjlt74FT0SWYfE,110 | ||
| addfips-0.2.0.dist-info/entry_points.txt,sha256=VtFu9ohRK5YeR0pkkowzFdRZuhnqi5ThC3iy5vtj9ms,46 | ||
| addfips-0.2.0.dist-info/metadata.json,sha256=13SkQQTI_FHfkUhLGPbMzGLufhELQ1CpmJ-6B1aC8L0,1043 | ||
| addfips-0.2.0.dist-info/top_level.txt,sha256=kZm--hklowyIyvGttMvEUEsV_cXlgc_XRThCa3kN27c,8 | ||
| addfips-0.2.1.dist-info/DESCRIPTION.rst,sha256=Ckgbsc4VJe8GHsRBvMjRVB3CggGf8v1G6XP9c669WJI,7591 | ||
| addfips-0.2.1.dist-info/METADATA,sha256=aUQXrMONdi7Ub0q_Nu5VIjsWlTMb392mdJjzCAE0uIw,8363 | ||
| addfips-0.2.1.dist-info/RECORD,, | ||
| addfips-0.2.1.dist-info/WHEEL,sha256=GrqQvamwgBV4nLoJe0vhYRSWzWsx7xjlt74FT0SWYfE,110 | ||
| addfips-0.2.1.dist-info/entry_points.txt,sha256=VtFu9ohRK5YeR0pkkowzFdRZuhnqi5ThC3iy5vtj9ms,46 | ||
| addfips-0.2.1.dist-info/metadata.json,sha256=4fQkXrcJWLfp7RfF73x4hA__Ry2glWQNi_X-wzTSpaY,1043 | ||
| addfips-0.2.1.dist-info/top_level.txt,sha256=kZm--hklowyIyvGttMvEUEsV_cXlgc_XRThCa3kN27c,8 |
Alert delta unavailable
Currently unable to show alert delta for PyPI packages.