$ git clone <this repo>
$ cd birth-names
$ mkvirtualenv birth-names
$ pip install -r requirements.txtFor local use, you can spin up a database in Postgres.app. Then, using the example provided in .env.sample as a template, save your access credentials in a new file named .env.
Afterward, don't forget to:
$ source .env$ python3 download.pyThe result should be two folders, data/us and data/uk. Each should contain many files with annual birth records for the respective country plus one summary file of total births with a name like us_births_by_year.csv (or uk_…).
$ python3 database.pyThe result should be three new empty tables in your database: year, birth_record, and name.
$ python3 process.pyCreates a data model for birth records and initializes a database schema using Peewee ORM. Loops through all U.S. and U.K. data files in /data/ and loads the records into a PostgreSQL database. This could take as long as a half hour to complete.
$ streamlit run analysis.pyStarts a local Streamlit server and opens a browser tab with an interactive time series chart rendered using Plotly Express. It should look like this:
