Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mileswwatkins/ssa_baby_names
Python wrapper for the Social Security Administration's Popular Baby Names service
https://github.com/mileswwatkins/ssa_baby_names
Last synced: about 5 hours ago
JSON representation
Python wrapper for the Social Security Administration's Popular Baby Names service
- Host: GitHub
- URL: https://github.com/mileswwatkins/ssa_baby_names
- Owner: mileswwatkins
- License: mit
- Created: 2014-09-28T17:44:35.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2014-11-01T03:58:51.000Z (about 10 years ago)
- Last Synced: 2024-10-03T07:18:35.749Z (about 1 month ago)
- Language: Python
- Homepage:
- Size: 219 KB
- Stars: 1
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
SSA Baby Names
==============About
-----
A Python wrapper for the Social Security Administration's [Popular Baby Names service](http://www.ssa.gov/OACT/babynames/).Provides access to the most popular names of both genders in a year of American history. Both the frequency of names and their relative frequencies (ie, percentage of all births of their gender) are available.
The top 1,000 names are available for a given gender and year; these encompass roughly 90% of all births. The earliest year in the database is 1880.
Installation
------------
`pip install ssa_baby_names`, or clone this Github repository.Usage
-----
What was the most popular name for boys in 1985?```
>>> from ssa_baby_names import get_top_names
>>> names = get_top_names(year=1985, name_gender_is_male=True)
>>> print(names.top().name)
Michael
```How popular was my name in that year?
```
>>> my_name = names.lookup("Miles")
>>> print(my_name)>>> print(my_name.rank)
396
>>> print(my_name.frequency)
497
>>> print(my_name.percentage)
0.0238
```