Skip to main content

Gender Guesser

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")
u'male'
>>> d.get_gender(u"Sally")
u'female'
>>> d.get_gender(u"Pauley") # should be androgynous
u'andy'

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")
u'ferhat'

I18N is fully supported:

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

Additionally, you can give preference to specific countries:

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

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")
u'female'
>>> d.get_gender(u"Sally")
u'female'

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

Licenses

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

Changelog

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.

Credits

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.

Metadata

Release files for gender-guesser 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for gender-guesser 0.2.0
File Size Uploaded Provenance Actions
gender-guesser-0.2.0.tar.gz 336.8 kB Without provenance Details for gender-guesser-0.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for gender-guesser 0.2.0
File Interpreter ABI Platform Actions
gender_guesser-0.2.0-py2.py3-none-any.whl Python 2, Python 3 none any Details for gender_guesser-0.2.0-py2.py3-none-any.whl

Total release size: 715.8 kB

Release files / gender-guesser-0.2.0.tar.gz

Download URL gender-guesser-0.2.0.tar.gz
Size 336.8 kB
Tags Source
SHA-256 checksum
How to use checksums
e55de155109199d6b5b87b755c0fa950a1b2a6a670cb28c1fe86f610a8956d55
BLAKE2b-256 checksum
How to use checksums
789a63063a52f7422fdb065915b08a973dbe89273fa0e99fe4e646cfd60d3daa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / gender_guesser-0.2.0-py2.py3-none-any.whl

Download URL gender_guesser-0.2.0-py2.py3-none-any.whl
Size 379.0 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
d7765c76c379ff938561f2e24a7047c997e86c630b8c6b6c0d280ce10d141ca1
BLAKE2b-256 checksum
How to use checksums
92502a8a3f8dbe56571ee8f09db4b323c28d9760512647183b38745befad19c3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for gender-guesser 0.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page