Name2Gender
From names in multiple languages to genders.
Installation
- From PyPi
pip install -U name2gender
or
uv add -U name2gender
- From Github
pip install git+https://github.com/vortezwohl/Name2Gender.git
Quick Start
-
Import SDKs
from name2gender import Name2Gender, Gender
-
Gender recognition based on names
n2g = Name2Gender() names = ['吴子豪', '吴彦祖', '梅艳芳', '张曼玉', 'Donald Trump', 'Ivanka Trump', 'Justin Bieber', 'The Weeknd', 'Luigi Nicholas Mangione', 'Elizabeth II', 'Henry VIII'] for name in names: _gender, _prob = n2g(name, return_probability=True) print(name, 'is', _gender, 'with a probability of', f'{_prob * 100:.2f}%')
stdout:
吴子豪 is Gender.Male with a probability of 99.71% 吴彦祖 is Gender.Male with a probability of 100.00% 梅艳芳 is Gender.Female with a probability of 99.99% 张曼玉 is Gender.Female with a probability of 99.92% Donald Trump is Gender.Male with a probability of 99.90% Ivanka Trump is Gender.Female with a probability of 99.66% Justin Bieber is Gender.Male with a probability of 100.00% The Weeknd is Gender.Male with a probability of 97.66% Luigi Nicholas Mangione is Gender.Male with a probability of 99.27% Elizabeth II is Gender.Female with a probability of 99.71% Henry VIII is Gender.Male with a probability of 99.90%
Use Name2Gender with CLI
-
Install model
n2g install name2gender-smallstdout:
Successfully installed model "name2gender-small". -
Predict genders
n2g predict LadyGagastdout:
"LadyGaga" is FEMALE with an probability of 99.64%. -
Uninstall model
n2g uninstall name2gender-smallstdout:
Model "name2gender-small" is uninstalled.
Metadata
Release files for name2gender 0.0.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| name2gender-0.0.5.tar.gz | 16.3 kB | Without provenance | Details for name2gender-0.0.5.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| name2gender-0.0.5-py3-none-any.whl | Python 3 | none | any | Details for name2gender-0.0.5-py3-none-any.whl |
Total release size: 33.7 kB
Release files / name2gender-0.0.5.tar.gz
| Download URL | name2gender-0.0.5.tar.gz |
|---|---|
| Size | 16.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7d3ca0f154c7696766cf7f1f40dc681fac0d0485c48a7a49477b02de0844f75f
|
|
BLAKE2b-256 checksum How to use checksums |
434243bc95bd27f20e9e3f13a99e08ff928e2f9a7e6ca27489a9bdb789953ec1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.6.14
|
Release files / name2gender-0.0.5-py3-none-any.whl
| Download URL | name2gender-0.0.5-py3-none-any.whl |
|---|---|
| Size | 17.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
248e20507f78ba482783d21c2e26b7394c33cacb16228fc7915ce98cfdae6b31
|
|
BLAKE2b-256 checksum How to use checksums |
1ba4ecc47c7dd665dbc3fad34cd95b9d5899f7e497bad803d2af58a7f5c6c64e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.6.14
|
Security for name2gender 0.0.5
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.