Intro
This project is called "Marriage" and checks the user's marital status against the Median Age At First Marriage for the same user State and sex, per the US Census Data.
What software does
- Ask the user for age, sex, state, marital status
- Validate user input
- Make an API request to Census Data API for Median Age At First Marriage, for the user State and sex
- Give the user the statistic of Median Age At First Marriage for the selected state and sex, and display a friendly comment that tell the user if he/she is early, late or in time depending on the user age and marital status
- Log the user stats in a CSV file, called stats.csv, with a timestamp
What features does the program have
- Functions, Variables, Constants
- Lists, Dictionaries
- Conditionals
- Exceptions
- Libraries: sys, requests, csv, datetime, os.path
- Unit Tests
- File I/O: writing CSV file
New skills acquired
- Working with the Census Data API
- How to check if a file already exists, via os.path library
- How to test system exit with pytest library
- Use datetime.now() method from datetime library to make a timestamp
- How to format a text file with Markdown syntax