Registry / analytics / genderize

genderize

JSON →
library0.3.1pypypi✓ verified 85d ago

A Python client for the Genderize.io web service, which predicts the gender of a given name. Version 0.3.1 is the latest. The library is stable but receives infrequent updates.

pip install genderize
INSTALL
IMPORT
SIG · GENDERIZE
G
genderize
analyticspythonv0.3.1
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Genderize
from genderize import Genderize
import genderize
Genderize is a class, not a module. Importing it directly gives you the module object, not the class.

Initialize with an optional API key and get gender predictions for one or more names.

from genderize import Genderize api_key = os.environ.get('GENDERIZE_API_KEY', '') genderize = Genderize(api_key=api_key) result = genderize.get(['James', 'Eva']) print(result)
Debug
Known issues
gotchaThe library expects an API key set as an environment variable or passed as a parameter. Without it, the free tier rate limit (1000 names/day) applies.
fix
Set the GENDERIZE_API_KEY environment variable or pass it to the constructor as `api_key='your_key'`.
affects: >=0.3.1
gotchaThe `get` method only accepts a list of names. Passing a single string will cause an error.
fix
Always wrap a single name in a list: `genderize.get(['John'])`.
affects: >=0.3.1
Errors
Common errors & fixes
TypeError: 'module' object is not callable
Trying to call `genderize.Genderize()` after `import genderize` incorrectly.
fix
Use `from genderize import Genderize` and then `Genderize()`.
AttributeError: module 'genderize' has no attribute 'Genderize'
Assuming the library is imported differently; common when using `import genderize` and then `genderize.Genderize`. Actually the class is directly importable.
fix
Use `from genderize import Genderize`.
Upgrade
Version history
0.3.1latest on PyPI · released Dec 24, 2018
Audit
Dependencies

No dependency data recorded yet.

Agent activity
10 hits · last 30 days
node
8
OpenAI (training)
1
Resources
genderize — pip install genderize · libregistry