Skip to content

eeghor/ethnicity

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 

Repository files navigation

ethnicity

Get ethnicity from name. Currently, we cover the following ethnicities:

  • Anglo-Saxon
  • Arabic
  • Chinese
  • Fijian
  • German
  • Greek
  • Hawaiian
  • Hispanic (Spanish and Mexican)
  • Indian (excluding islamic states)
  • Iranian
  • Italian
  • Japanese
  • Khmer (Cambodian)
  • Korean
  • Polish
  • Portuguese (Portuguese and Brazilian)
  • Russian
  • Samoan
  • South-Slavic (Serbian, Croatian, Bosnian, Slovenian)
  • Thai
  • Turkish
  • Vietnamese

Data Sources

Installation

pip3 install ethnicity

Usage

from ethnicity import Ethnicity

# initialize and create dictionaries
e = Ethnicity().make_dicts()  

# apply to a list of names
e.get(['emele kuoi', 'andrew miller', 'peter', 'andrey',  'nima al hassan', 'tomasz bolowski', 'christiano ronaldo', 'parisa karimi,', 'lisa bowen', 'melissa chan'])

# which gives you a pandas dataframe as below
                 Name    Ethnicity
0          Emele Kuoi       fijian
1       Andrew Miller  anglo-saxon
2               Peter          ---
3              Andrey      russian
4      Nima Al Hassan       arabic
5     Tomasz Bolowski       polish
6  Christiano Ronaldo   portuguese
7       Parisa Karimi      iranian
8          Lisa Bowen  anglo-saxon
9        Melissa Chan      chinese

Releases

No releases published

Packages

No packages published