Skip to content

Instantly share code, notes, and snippets.

@dersteppenwolf
Created September 17, 2012 16:33
Show Gist options
  • Save dersteppenwolf/3738371 to your computer and use it in GitHub Desktop.
Save dersteppenwolf/3738371 to your computer and use it in GitHub Desktop.
a python script to convert arcmap labels to proper case
import re
def title(value):
value = value.decode('utf-8')
t = re.sub("([a-z])'([A-Z])", lambda m: m.group(0).lower(), value.title())
return re.sub("\d([A-Z])", lambda m: m.group(0).lower(), t)
title(!NOM_MUNICI!)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment