==============
Gender Guesser
==============
.. image:: https://travis-ci.org/lead-ratings/gender-guesser.svg?branch=master
:target: https://travis-ci.org/lead-ratings/gender-guesser
This package uses the underlying data from the program "gender" by Jorg Michael (described `here <http://www.autohotkey.com/community/viewtopic.php?t=22000>`_). Its use is pretty straightforward::
>>> import gender_guesser.detector as gender
>>> d = gender.Detector()
>>> print(d.get_gender(u"Bob"))
male
>>> print(d.get_gender(u"Sally"))
female
>>> print(d.get_gender(u"Pauley")) # should be androgynous
andy
The result will be one of ``unknown`` (name not found), ``andy`` (androgynous), ``male``, ``female``, ``mostly_male``, or ``mostly_female``. The difference between ``andy`` and ``unknown`` is that the former is found to have the same probability to be male than to be female, while the later means that the name wasn't found in the database.
I18N is fully supported::
>>> print(d.get_gender(u"\xc1lfr\xfan")) # u"Álfrún"
female
Additionally, you can give preference to specific countries::
>>> print(d.get_gender(u"Jamie"))
mostly_female
>>> print(d.get_gender(u"Jamie", u'great_britain'))
mostly_male
Additionally, you can create a detector that is not case sensitive (default *is* to be case sensitive)::
>>> d = gender.Detector(case_sensitive=False)
>>> print(d.get_gender(u"sally"))
female
>>> print(d.get_gender(u"Sally"))
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.3.0 (2016-07-02)
******************
* Remove ``unknown_value`` init option, since it can be implemented very easily with a wrapper if needed.
* Return ``unknown`` when name is not found and ``andy`` when it is valid equally for both male and female.
* Test README examples as doctests.
* Fix incorrect country-wise gender detection for non-iso886-15 names coming from line length change after data file conversion to UTF-8. See #gh2. Thanks @miquelcamprodon.
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 <https://github.com/ferhatelmas/sexmachine/>`_.
Credits
=======
This is a fork of the ``SexMachine`` package by `Ferhat Elmas <https://github.com/ferhatelmas>`_. 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.
Raw data
{
"_id": null,
"home_page": "https://github.com/lead-ratings/gender-guesser",
"name": "gender-guesser",
"maintainer": null,
"docs_url": null,
"requires_python": null,
"maintainer_email": null,
"keywords": null,
"author": "Israel Saeta P\u00e9rez",
"author_email": "israel@lead-ratings.com",
"download_url": "https://files.pythonhosted.org/packages/a8/dc/69939b7af56b7adf3aa2736771b7c3e7191f7cd36fbc80b0727570c275fa/gender-guesser-0.4.0.tar.gz",
"platform": "UNKNOWN",
"description": "==============\nGender Guesser\n==============\n\n.. image:: https://travis-ci.org/lead-ratings/gender-guesser.svg?branch=master\n :target: https://travis-ci.org/lead-ratings/gender-guesser\n\n\nThis package uses the underlying data from the program \"gender\" by Jorg Michael (described `here <http://www.autohotkey.com/community/viewtopic.php?t=22000>`_). Its use is pretty straightforward::\n\n >>> import gender_guesser.detector as gender\n >>> d = gender.Detector()\n >>> print(d.get_gender(u\"Bob\"))\n male\n >>> print(d.get_gender(u\"Sally\"))\n female\n >>> print(d.get_gender(u\"Pauley\")) # should be androgynous\n andy\n\nThe result will be one of ``unknown`` (name not found), ``andy`` (androgynous), ``male``, ``female``, ``mostly_male``, or ``mostly_female``. The difference between ``andy`` and ``unknown`` is that the former is found to have the same probability to be male than to be female, while the later means that the name wasn't found in the database.\n\nI18N is fully supported::\n\n >>> print(d.get_gender(u\"\\xc1lfr\\xfan\")) # u\"\u00c1lfr\u00fan\"\n female\n\nAdditionally, you can give preference to specific countries::\n\n >>> print(d.get_gender(u\"Jamie\"))\n mostly_female\n >>> print(d.get_gender(u\"Jamie\", u'great_britain'))\n mostly_male\n\nAdditionally, you can create a detector that is not case sensitive (default *is* to be case sensitive)::\n\n >>> d = gender.Detector(case_sensitive=False)\n >>> print(d.get_gender(u\"sally\"))\n female\n >>> print(d.get_gender(u\"Sally\"))\n female\n\nTry to avoid creating many Detectors, as each creation means reading the data file.\n\nLicenses\n========\n\nThe generator code is distributed under the GPLv3. The data file nam_dict.txt is released under the GNU Free Documentation License.\n\n\nChangelog\n=========\n\n0.3.0 (2016-07-02)\n******************\n\n* Remove ``unknown_value`` init option, since it can be implemented very easily with a wrapper if needed.\n* Return ``unknown`` when name is not found and ``andy`` when it is valid equally for both male and female.\n* Test README examples as doctests.\n* Fix incorrect country-wise gender detection for non-iso886-15 names coming from line length change after data file conversion to UTF-8. See #gh2. Thanks @miquelcamprodon.\n\n\n0.2.0 (2015-12-06)\n******************\n\n* Wire in ``tox`` to test in both Python 2 and Python 3.\n* Python 2 and 3 compatiblity.\n* Remove obsolete character mapper code.\n\nFor previous versions, see `sexmachine <https://github.com/ferhatelmas/sexmachine/>`_.\n\n\nCredits\n=======\n\nThis is a fork of the ``SexMachine`` package by `Ferhat Elmas <https://github.com/ferhatelmas>`_. 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.",
"bugtrack_url": null,
"license": "GPLv3",
"summary": "Get the gender from first name.",
"version": "0.4.0",
"project_urls": {
"Download": "UNKNOWN",
"Homepage": "https://github.com/lead-ratings/gender-guesser"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "13fb3f2aac40cd2421e164cab1668e0ca10685fcf896bd6b3671088f8aab356e",
"md5": "9f1e052c464a9583788df7ad901def59",
"sha256": "7cb01ce5d8d43b94573498bc02c959b622872abd399622ca67d1b73ba6e7e222"
},
"downloads": -1,
"filename": "gender_guesser-0.4.0-py2.py3-none-any.whl",
"has_sig": false,
"md5_digest": "9f1e052c464a9583788df7ad901def59",
"packagetype": "bdist_wheel",
"python_version": "2.7",
"requires_python": null,
"size": 379297,
"upload_time": "2016-12-05T11:41:47",
"upload_time_iso_8601": "2016-12-05T11:41:47.759557Z",
"url": "https://files.pythonhosted.org/packages/13/fb/3f2aac40cd2421e164cab1668e0ca10685fcf896bd6b3671088f8aab356e/gender_guesser-0.4.0-py2.py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "a8dc69939b7af56b7adf3aa2736771b7c3e7191f7cd36fbc80b0727570c275fa",
"md5": "32f5cf52eeacf4462cc552c55cf6c031",
"sha256": "1591c14592805ca7da06a46d5f7202511f7cb87547049a68dfccbeedb879f31b"
},
"downloads": -1,
"filename": "gender-guesser-0.4.0.tar.gz",
"has_sig": false,
"md5_digest": "32f5cf52eeacf4462cc552c55cf6c031",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 337238,
"upload_time": "2016-12-05T11:41:44",
"upload_time_iso_8601": "2016-12-05T11:41:44.554559Z",
"url": "https://files.pythonhosted.org/packages/a8/dc/69939b7af56b7adf3aa2736771b7c3e7191f7cd36fbc80b0727570c275fa/gender-guesser-0.4.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2016-12-05 11:41:44",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "lead-ratings",
"github_project": "gender-guesser",
"travis_ci": true,
"coveralls": false,
"github_actions": false,
"tox": true,
"lcname": "gender-guesser"
}