Skip to main content

Prediction of genders of english names based on US Social Security data. The gender probability of each name is computed based on the number of male and female babies that were given this name between 1880 and 2017.

The full data can be found at https://www.ssa.gov/oact/babynames/limits.html

Description

The main function returns the probability for a given english name to be a male name. There are optional arguments start_year (default 1880) and end_year (default 2018) to use a specific period of time for calculation. For instance, for gender prediction of babyboomers, the period can be set to 1946-1965. If the name is absent from the database, None is returned.

Installation

Requires package sqlite3. The code was only tested with Python 3.7.

$ pip install NameGenderPredictor

Basic Usage

Function predict_gender is case insensitive for names (see below).

>>> from NameGenderPredictor import predict_gender
>>> print(predict_gender('john'))
0.9957852975260119
>>> print(predict_gender('Avi'))
0.8783253379851723
>>> print(predict_gender('chris'))
0.8632186721917374
>>> print(predict_gender('chris'),start_year=2000,end_year=2010)
0.9833235466823254
>>> print(predict_gender('chris'),start_year=1950,end_year=1965)
0.8111958317448215

Release files for NameGenderPredictor 0.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for NameGenderPredictor 0.0.1
File Size Uploaded
NameGenderPredictor-0.0.1.tar.gz 5.2 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for NameGenderPredictor 0.0.1
File Interpreter ABI Platform
NameGenderPredictor-0.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 10.5 MB

Release files / NameGenderPredictor-0.0.1.tar.gz

Download URL NameGenderPredictor-0.0.1.tar.gz
Size 5.2 MB
Tags Source
SHA-256 checksum
How to use checksums
d6a34f697c93fa0588dd1b1e68dc0163da08dab06bf7d898b420e60252ed05a6
BLAKE2b-256 checksum
How to use checksums
a94357aafaff00c5b84abde2879a61187d2f54b114d4f6a28c37377d0ecf1aae
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/49.2.0 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.7.3

Release files / NameGenderPredictor-0.0.1-py3-none-any.whl

Download URL NameGenderPredictor-0.0.1-py3-none-any.whl
Size 5.3 MB
Tags Python 3
SHA-256 checksum
How to use checksums
229a21645134a8c6ac7c32df8d48c2d03d6241cee2736c2aec99819139160ec4
BLAKE2b-256 checksum
How to use checksums
c2e601e10e0721fc6190252e4cd89743950c93f3551605ff309c8d247d65c363
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/49.2.0 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.7.3

Release history Release notifications | RSS feed

This release

0.0.1 This release

2 release 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