Skip to content
This repository has been archived by the owner on Feb 5, 2021. It is now read-only.
/ genderator Public archive

A Python library to determine gender based on first name, with i18n support.

License

Notifications You must be signed in to change notification settings

bmuller/genderator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Genderator

This Python package uses the underlying data from the program "gender" by Jorg Michael (described here). It's use is pretty straightforward:

>>> from genderator.detector import *
>>> d = Detector()
>>> d.getGender('Bob') == MALE
True
>>> d.getGender('Sally') == FEMALE
True
>>> d.getGender('Pauley') == ANDROGYNOUS
True

I18N is fully supported:

>>> d.getGender(u'Álfrún') == FEMALE
True
>>> d.getGender(u'\301lfr\372n') == FEMALE
True

If you have an alterative data file, you can pass that in as an optional argument to the Detector.

Try to avoid creating many Detectors, as each creation means reading in the data file.

Licenses

The genderator code is distributed under the GPLv3. The data file nam_dict.txt is released under the GNU Free Documentation License.

About

A Python library to determine gender based on first name, with i18n support.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages