Skip to main content

Genderize

Client for the 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/travis/SteelPangolin/genderize.svg?style=flat https://img.shields.io/codecov/c/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, an API key, and a shorter timeout than the default 30 seconds. 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',
    timeout=5.0)
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'}]

Maintenance

Setup for local development:

virtualenv --prompt '(genderize) ' venv -p python3
pip install -r requirements.txt
pip install -r requirements-dev.txt

Release checklist:

  1. Generate a new version number: major.minor.micro. It should be compatible with both PEP 440 and SemVer 2.0.0.

  2. Update __version__ in genderize/__init__.py. This is read by setup.py and doesn’t need to be changed there.

  3. Add a changelog entry and date for the new version in CHANGES.rst.

  4. Commit the changes. This may be done as part of another change.

  5. Tag the commit with git tag major.minor.micro.

  6. Push the tag to GitHub with git push origin major.minor.micro.

  7. Travis will create a new PyPI release from the tag.

Release files for Genderize 0.3.1

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

Source distribution (sdist)

Source distribution for Genderize 0.3.1
File Size Uploaded
Genderize-0.3.1.tar.gz 6.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for Genderize 0.3.1
File Interpreter ABI Platform
Genderize-0.3.1-py3-none-any.whl Python 3 none any Details

Total release size: 11.9 kB

Release files / Genderize-0.3.1.tar.gz

Download URL Genderize-0.3.1.tar.gz
Size 6.2 kB
Tags Source
SHA-256 checksum
How to use checksums
7a1db1e37482b27581a2f2f2d03aadf43f31678b26e99e04c5b4803ca39de177
BLAKE2b-256 checksum
How to use checksums
c48df617ade3ccfc4dccdc84250ddd719d4ea3216beb809b09f648b455c54270
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.12.1 pkginfo/1.4.2 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.1

Release files / Genderize-0.3.1-py3-none-any.whl

Download URL Genderize-0.3.1-py3-none-any.whl
Size 5.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f4552b17bf26a5ffae2c29c11bfd0f75a48ab6a834fb6073458c16bcdb6a5ef0
BLAKE2b-256 checksum
How to use checksums
d922d287d4b6599b3247631a7dcd4ae6e440338b73f9836182b74c33e1b7261e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.12.1 pkginfo/1.4.2 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.1

Release history Release notifications | RSS feed

This release

0.3.1 This release

2 release files

0.3.0

2 release files

0.2.0

3 release files

0.1.5

3 release files

0.1.4

3 release files

0.1.3

3 release files

0.1.2

2 release files

0.1.1

1 release file

0.1.0

1 release file

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