Genderize

Client for Genderize.io web service.

https://img.shields.io/github/license/steelpangolin/genderize.svg?style=flat https://img.shields.io/pypi/v/Genderize.svg?style=flat https://img.shields.io/pypi/dm/Genderize.svg?style=flat https://img.shields.io/travis/SteelPangolin/genderize.svg?style=flat https://img.shields.io/codeclimate/github/SteelPangolin/genderize.svg?style=flat https://img.shields.io/codeclimate/coverage/github/SteelPangolin/genderize.svg?style=flat https://readthedocs.org/projects/genderize/badge/?style=flat

Basic usage

Import the Genderize class and call its get method with a list of names.

from genderize import Genderize
print(Genderize().get(['James', 'Eva', 'Thunderhorse']))
[{u'count': 1037, u'gender': u'male', u'name': u'James', u'probability': 0.99},
 {u'count': 234, u'gender': u'female', u'name': u'Eva', u'probability': 1.0},
 {u'gender': None, u'name': u'Thunderhorse'}]

Shell usage

If run as a script, takes a list of names on stdin, and prints them with their genders.

echo "James\nEva\nThunderhorse" | python -m genderize
James: male
Eva: female
Thunderhorse: None

Advanced usage

Create a Genderize instance with a custom user agent, and an API key. Note that you’ll need to use your own API key or this example won’t work.

from genderize import Genderize
genderize = Genderize(
    user_agent='GenderizeDocs/0.0',
    api_key='example_api_key')
print(genderize.get(['James', 'Eva', 'Thunderhorse']))
[{u'count': 1037, u'gender': u'male', u'name': u'James', u'probability': 0.99},
 {u'count': 234, u'gender': u'female', u'name': u'Eva', u'probability': 1.0},
 {u'gender': None, u'name': u'Thunderhorse'}]

Change Log

0.1.5

2015-10-09

0.1.4

2015-06-21

  • Switched to HTTPS endpoint.
  • Incorporated granteagon‘s patch for _fixtypes.
  • Added support for paid API keys.
  • Included Sphinx API docs.

0.1.3

2015-01-16

  • Supports Python 2.6, 2.7, 3.2, 3.3, and 3.4.
  • Added an integration test that calls the Genderize.io API server.
  • Now using Travis CI.

0.1.2

2014-11-26

  • Python 3 support.

0.1.1

2014-06-20

0.1.0

2014-03-15

  • Initial release.

Indices and tables