NameGender Python
pip install namegender-client
from namegender import NameGender
client = NameGender("YOUR_API_KEY")
result = client.name("Ayşe", country="TR")
print(result["gender"], result["probability"], result["sample_size"], result["confidence"])
Options and response
name, email, username and bulk accept country, ai_fallback and
best_guess as keyword arguments:
result = client.name("Andrea", country="IT", best_guess=True)
A result carries query, name, gender, country, probability,
sample_size, took_ms, source, confidence and matched_as, alongside
credits_charged, credits_remaining, data_version and request_id.
Success is the HTTP status: any non-2xx response raises NameGenderError
with status and body ({"error", "message", "request_id", "docs"}).
Branch on body["error"], not on the message.
Country distribution
Returns the countries a name is recorded in. This is not a country-of-origin or ethnicity inference, and must not be used as one.
result = client.countries("Mehmet", limit=10)
print(result["registrations"]) # [{"country": "FR", "count": 3775, "share": 58.97, "gender": "male", "probability": 99, "source": "insee"}, ...]
print(result["attested_in"]) # ["AL", "AU", "BE", ..., "TR", "US"]
print(result["basis"]["note"])
The two lists are deliberately kept apart. registrations is measured volume and
is comparable only among the seven countries that publish counted birth
statistics (US, UK, France, Canada, Spain, Ireland, Norway); share is a
percentage across those counts alone. attested_in is presence with no weight
attached, which is where countries that publish no counts, such as Turkey, Japan
and India, appear. Show basis["note"] next to any percentage you display.
limit (1–100, default 25) caps how many counted countries come back in
registrations. One credit per request.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file namegender_client-0.3.0.tar.gz.
File metadata
- Download URL: namegender_client-0.3.0.tar.gz
- Upload date:
- Size: 4.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9d2e8a68ea0e52fc80fbc8db7be665a5ac40b6ad45048fd24c59a0dd55d4b501
|
|
| MD5 |
6af0cc3fc88d97d68ded42dd239fb677
|
|
| BLAKE2b-256 |
ccd36dfbab76f19e38a0f2b625ba6ff48f9baf0efc88c65460a5af22983ff102
|
Provenance
The following attestation bundles were made for namegender_client-0.3.0.tar.gz:
Publisher:
release.yml on anpekesen/namegender-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
namegender_client-0.3.0.tar.gz -
Subject digest:
9d2e8a68ea0e52fc80fbc8db7be665a5ac40b6ad45048fd24c59a0dd55d4b501 - Sigstore transparency entry: 2863239885
- Sigstore integration time:
-
Permalink:
anpekesen/namegender-python@13bf34dbf0ca5b30dcaf2bd08cbe3a9bce400e19 -
Branch / Tag:
refs/tags/v0.3.0 - Owner: https://github.com/anpekesen
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@13bf34dbf0ca5b30dcaf2bd08cbe3a9bce400e19 -
Trigger Event:
push
-
Statement type:
File details
Details for the file namegender_client-0.3.0-py3-none-any.whl.
File metadata
- Download URL: namegender_client-0.3.0-py3-none-any.whl
- Upload date:
- Size: 4.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d2f0704ecff03c4b7ece966a5788c6193f1fd9c4359eb0f74a5eee4528ba3d2e
|
|
| MD5 |
a5287886a5975566a8c379ea47481914
|
|
| BLAKE2b-256 |
7ab36cc22c5c007e945d27135cacb284f83aeb9c75114fbf563dc2681a9b1b88
|
Provenance
The following attestation bundles were made for namegender_client-0.3.0-py3-none-any.whl:
Publisher:
release.yml on anpekesen/namegender-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
namegender_client-0.3.0-py3-none-any.whl -
Subject digest:
d2f0704ecff03c4b7ece966a5788c6193f1fd9c4359eb0f74a5eee4528ba3d2e - Sigstore transparency entry: 2863240584
- Sigstore integration time:
-
Permalink:
anpekesen/namegender-python@13bf34dbf0ca5b30dcaf2bd08cbe3a9bce400e19 -
Branch / Tag:
refs/tags/v0.3.0 - Owner: https://github.com/anpekesen
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@13bf34dbf0ca5b30dcaf2bd08cbe3a9bce400e19 -
Trigger Event:
push
-
Statement type: