npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

gender-probability

v0.1.1-3

Published

Providing gender probabilities for US/UK names using Open Gender Tracker's "Global Name Data" resource.

Downloads

55

Readme

gender-probability

Providing gender probabilities for US/UK names using Open Gender Tracker's Global Name Data resource.

Introduction

There are not a lot of tools out there that provide nuanced gender guesses for names. Global Name Data, created by Irene Ros and Adam Hyland while working at Bocoup, is an excellent resource that provides gender probabilities and confidence intervals for first names found in the US and the UK. You can read more about the project here, including details on how gender data is aggregated. Their project even provides the code they used to define and scrape gender information, so if you'd like to tweak it and make your own data set, you're welcome to do so.

I made this Node module as a way to quickly access their data in a convenient way.

Documentation

Install the module with: npm install gender-probability

Load the library with .load() and then individually load any of the data files ("us" or "uk" or both).

var genderProb = require('gender-probability');

// load the data files for either 'us' (default) or 'uk'
// these are ~5MB each and are loaded into memory
genderProb.load(); // 'us' by default
genderProb.load('uk');

Use .get(name, country) to get gender probability for a name. The country in question must be loaded.

// get gender info for a name
var caseyInfo = genderProb.get('Casey'); // country is 'us' by default

The data returned will look like this:

{
  "error": null,
  "data": {
    "prob": {
      "male": 0.591264319772974,
      "female": 0.408735680227026,
      "gender": "Unknown"
    },
    "confidence": {
      "upper": 0.593521954180142,
      "lower": 0.589002829207331
    }
  }
}

Example Usage

var genderProb = require('gender-probability');
genderProb.load(); // 'us' by default

var data = genderProb.get('Cameron');
if (!data.error) {
  console.log(data.data.prob.gender) // "Male"
}

Contributing

In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using Grunt.

License (Data)

The following license information is copied directly from the Open Gender Tracker projects Global Name Data license.

For the sake of convenience all data for this project are licensed under CC-BY 3.0.

Data gathered from government sources on baby names are individually licensed as follows:

The terms of the Open Government License are "intended to be interoperable" with the Creative Commons CC-BY license.

Additionally, database rights are not recognized in the United States although they are recognized in the UK, EU and additional jurisdictions. As such, data from databases such as these may not be copyrightable in the United States.

License

Copyright (c) 2014 Kazemi, Darius Licensed under the MIT license.