Coverage for /pythoncovmergedfiles/medio/medio/usr/local/lib/python3.11/site-packages/nameparser/util.py: 90%
Shortcuts on this page
r m x toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
Shortcuts on this page
r m x toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
1import logging
2from typing import Literal
4# http://code.google.com/p/python-nameparser/issues/detail?id=10
5log = logging.getLogger('HumanName')
6log.addHandler(logging.NullHandler())
9HumanNameAttributeT = Literal['title', 'first', 'middle', 'last', 'suffix', 'nickname', 'surnames']
12def lc(value: str) -> str:
13 """Lowercase and strip leading/trailing periods to normalize for comparison."""
14 if not value:
15 return ''
16 return value.lower().strip('.')