Skip to content

Instantly share code, notes, and snippets.

@namsor
Last active August 29, 2015 14:06
Show Gist options
  • Save namsor/b676197a5930baae7032 to your computer and use it in GitHub Desktop.
Save namsor/b676197a5930baae7032 to your computer and use it in GitHub Desktop.
Python API wrapper to determine the gender of a personal name
# 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