Building a Simple Birthday App with Flask-SQLAlchemy

Bob, Thu 11 May 2017, Flask

birthday, calendar, datetime, Facebook, Flask, Flask-SQLAlchemy, icalendar, SQLAlchemy

One of my favorite Flask extensions is Flask-SQLAlchemy. It makes working with a database a breeze. For some time I wanted to detach my birthday management from Facebook. So I started a simple Flask app. Work so far here.

FB birthday data

I am almost sure you could use the FB API before to pull all your friends and birthdays. Not anymore :(

Luckily I found a way to export them and parse them into a useful format - see bdays.py.

Starting Flask-SQLAlchemy

Back to the article subject: how do we get this data into a DB? Flask-SQLAlchemy to the rescue:

Resulting App

bday app upcoming

bday app for a particular month

You can use the calendar module to get the month name for a month int:

month_name = calendar.month_name[month]

See app.py.

TODO

This is it for starters. In part 2 I will make the app more functional:

Resources


Keep Calm and Code in Python!

-- Bob