Client for Genderize.io web service.
Project description
Genderize
Client for Genderize.io web service.
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'}]
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Genderize-0.1.4.tar.gz
(4.5 kB
view hashes)
Built Distributions
Close
Hashes for Genderize-0.1.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e96dea97804c489937ad8605df06a48b2529d67166af893ba563d851c3dfd3ca |
|
MD5 | f8f675c3441d937ed0e1a125ef7a0b5b |
|
BLAKE2b-256 | e59a8f67a57db1416d7ceefe8866dc7d3ee0d9e399dba6a3e09b61c41560bf9b |
Close
Hashes for Genderize-0.1.4-py2-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8a8dec1963edcf9dbcf862af81ac0ecf2d46ec74ba150257e7b4a25ee3a01b7d |
|
MD5 | ad8d71779082ff449886561b93b6611e |
|
BLAKE2b-256 | d7f0d7ca2de84a2c863889a2e0a30fd8306dedc8c2de6dbbe479d8fc7c083fb1 |