Skip to main content

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

namegender_client-0.3.1.tar.gz (4.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

namegender_client-0.3.1-py3-none-any.whl (4.5 kB view details)

Uploaded Python 3

File details

Details for the file namegender_client-0.3.1.tar.gz.

File metadata

  • Download URL: namegender_client-0.3.1.tar.gz
  • Upload date:
  • Size: 4.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for namegender_client-0.3.1.tar.gz
Algorithm Hash digest
SHA256 4cf4963c87f2b18dfd1e7e8a0c086a311a4cdd86eded6eb78b3e52a5093e2b2f
MD5 f8b6b5e38ddfcbf642880ee1d15ff823
BLAKE2b-256 e1bde82b14b2198066f5790182cad9f0c894d5fa3ab2535f4c130c37ed3e93c9

See more details on using hashes here.

Provenance

The following attestation bundles were made for namegender_client-0.3.1.tar.gz:

Publisher: release.yml on anpekesen/namegender-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file namegender_client-0.3.1-py3-none-any.whl.

File metadata

File hashes

Hashes for namegender_client-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 3eb03b1d8ca45da30fea8b5cdb0bfdd4390b4a004c254978d2b93d34e0cb745b
MD5 20dc5984595b04baf4b63928282f34ac
BLAKE2b-256 d6768e315ad36ac834527774594f61d875482db999f7dc0c250d19e269e13b90

See more details on using hashes here.

Provenance

The following attestation bundles were made for namegender_client-0.3.1-py3-none-any.whl:

Publisher: release.yml on anpekesen/namegender-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

0.3.1 This release

2 files

0.3.0

2 files

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