Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Script for scraping data on baby names from the website of the Social Security Administration.
Python
tree: 1a949d3924

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
LICENSE
README
babynames.py

README

This is a script for scraping data on popular baby names from the Social Security Administration's website (http://www.ssa.gov/OACT/babynames/index.html).

It can be used to get nationwide data on the top 1,000 names for each sex in each year since 1880, and state-by-state data on the top 100 names for each sex in each year since 1960.

Requires: Python >= 2.6

Usage
------------------------------

Get national data, sent to standard output in CSV format:

    $ python babynames.py

Get national data, saving it to a file in CSV format:

    $ python babynames.py -f names.csv

Get state-by-state data, for all states

    $ python babynames.py -s All

Get state data for Virginia, Maryland and Pennsylvania, saving it to a file:

    $ python babynames.py -s VA,PA,MD -f mystates.csv
Something went wrong with that request. Please try again.