Last active
August 29, 2015 14:06
-
-
Save namsor/b676197a5930baae7032 to your computer and use it in GitHub Desktop.
Python API wrapper to determine the gender of a personal name
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# use hammock from https://github.com/kadirpekel/hammock | |
from hammock import Hammock as GendreAPI | |
gendre = GendreAPI("http://api.namsor.com/onomastics/api/json/gendre") | |
# example call to GendRE API, will automatically recognize country/culture and return gender | |
resp = gendre('Jean','Parker').GET() | |
print (resp.json().get('gender')) | |
# returns: female | |
# gendre('Jean','Marchand') would return 'male' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment