Table Of Contents

SW Utilities


Sw Utilities are a set of stand alone utilities for dataframe processing.

Geocoding


The Geocoding utility is defined in the geocoding utility document.

Dataframe Subset


The Dataframe Subset utility is defined in the subset utility document.

Census


The Census utility is defined in the census utility document.

Zip Codes


The Zip Code utility allows you look up zipcodes for an addresses and to get zip code attributes.


Get Zipcode Attributes


Get Zip Code Attributes allows you to get the complete set of USPS zip code attributes.



Zipcode Attributes


Get Zipcode By Location



Get Zipcodes For City


Zipcodes For City


Get State Counties



State Counties



Get County Cities



County Cities


Get State Cities




State Cities


Zip Code APIs


All zip code APIs can be imported from dfcleanser.sw_utilities.sw_utility_zipcode_model.py

Zip Code Attributes APIs


  • get_cities_for_zipcode(...)
  • def get_cities_for_zipcode(zipcode,city_type=PRIMARY_CITY_TYPE,active_status=ACTIVE_STATUS_TYPE)

  • get_county_for_zipcode(...)
  • def get_county_for_zipcode(zipcode)

  • get_state_for_zipcode(...)
  • def get_state_for_zipcode(zipcode)

  • get_latitude_for_zipcode(...)
  • def get_latitude_for_zipcode(zipcode)

  • get_longitude_for_zipcode(...)
  • def get_longitude_for_zipcode(zipcode)

  • get_areacodes_for_zipcode(...)
  • def get_areacodes_for_zipcode(zipcode)

  • get_type_for_zipcode(...)
  • def get_type_for_zipcode(zipcode)

  • is_zipcode_active((...)
  • def is_zipcode_active(zipcode)

Zip Code Demographic APIs


  • get_zipcodes_for_city(...)
  • def get_zipcodes_for_city(state, city, zipcode_type=ANY_ZIPCODE_TYPE, active_status=ACTIVE_STATUS_TYPE)

  • get_counties_for_state(...)
  • def get_counties_for_state(state)

  • get_cities_for_county(...)
  • def get_cities_for_county(state,county,city_type)

  • get_cities_for_state(...)
  • def get_cities_for_state(state,city_type)

Zipcode Attributes Values

City Type


  • PRIMARY
  • City assigned primarily to zip code.

  • ACCEPTABLE
  • Non Primary City acceptable to zip code. Will be forwarded with note.

  • NOT ACCEPTABLE
  • City not acceptable for zip code. Will be returned with note.

  • ANY
  • Generic type covering all above.

Status Type


  • ACTIVE
  • Currently active zip code.

  • DECOMMISIONED
  • Decommisioned zip code.

  • EITHER
  • Either type of zip code.

Zipcode Type


  • UNIQUE
  • Reserved for govt facilities such as IRS facilities or govt labs.

  • STANDARD
  • Standard normal zip code area.

  • PO BOX
  • Zip Code for a specific po box.

  • MILITARY
  • Military zip code.

  • DIPLOMATIC
  • Diplomatic zip code.

  • APO
  • Army Post Office.

  • FPO
  • Fleet Post Office.

  • DPO
  • Diplomatic Post Office.

  • ANY
  • Generic covering all types.