Skip to main content

Get the gender from first name.

Project description

This package uses the underlying data from the program “gender” by Jorg Michael (described here). Its use is pretty straightforward:

>>> import gender_guesser.detector as gender
>>> d = gender.Detector()
>>> d.get_gender(u"Bob")
>>> d.get_gender(u"Sally")
>>> d.get_gender(u"Pauley") # should be androgynous

The result will be one of andy (androgynous), male, female, mostly_male, or mostly_female. Any unknown names are considered andies. Moreover, you can set unknown value to whatever you want:

>>> d = gender.Detector(unknown_value=u"ferhat")
>>> d.get_gender(u"Pauley")

I18N is fully supported:

>>> d.get_gender(u"Álfrún")

Additionally, you can give preference to specific countries:

>>> d.get_gender(u"Jamie")
>>> d.get_gender(u"Jamie", u'great_britain')

Additionally, you can create a detector that is not case sensitive (default is to be case sensitive):

>>> d = gender_guesser.detector.Detector(case_sensitive=False)
>>> d.get_gender(u"sally")
>>> d.get_gender(u"Sally")

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


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


0.2.0 (2015-12-06)

  • Wire in tox to test in both Python 2 and Python 3.
  • Python 2 and 3 compatiblity.
  • Remove obsolete character mapper code.

For previous versions, see sexmachine.


This is a fork of the SexMachine package by Ferhat Elmas. It was created to be able to publish a Python 3 compatible version to PyPI and to be able add some more improvements without bugging the original author.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
gender_guesser-0.2.0-py2.py3-none-any.whl (379.0 kB) Copy SHA256 hash SHA256 Wheel py2.py3
gender-guesser-0.2.0.tar.gz (336.8 kB) Copy SHA256 hash SHA256 Source None

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page