Introduction to Building Web Applications from Data

A series on building a simple Flask app that reads and filters a data file.

This series assumes you've finished Introduction to Simple Web Applications with Flask

The articles

[DRAFT] Parsing the Congressmember Data for our birthday Flask app
After fetching the raw text data, we need to convert it to a data
[DRAFT] Creating a Flask app for listing Congressmembers' birthdays
Creating a birthday listing is easy after we've fetched and parsed the data.

Creating an app from data

One of the best Flask tutorials out there is NICAR's First News App guide, which walks you through all the steps to set-up from scratch to creating a complete web application based off of data from the Los Angeles riots.

You can see it in action here:

It's not a bad place to start, and if you've finished the previous series, you might be able to try it out, though it contains a lot of set up steps (setting up Github and virtualenv) that you don't need to actually do to get a Flask app going.

The series that I provide here is an intermediary step to going big-time news app development.

The data and the app

The Sunlight Foundation compiles legislator data in a convenient spreadsheet. Let's build a news app that…on any given day, will show which Congressmembers have birthdays, and how old they are. and since so many of them have Twitter accounts, and the Sunlight spreadsheet has collected that information for every congressmember, we should make it easy to tweet 'Happy Birthday' at the legislator.

This ends up not being much of a Flask app, but being more practice on how to work with data, no matter what you intend to build with it. To underscore the point that this is going to be not at all about cool design, here's a screenshot of the final app:

image happy-birthday-kevin-brady.jpg

Ugly design aside, this series is meant to practice the ability to break up and organize an application into separate files. Instead of making just, our Flask app will have several files. Here's the intended folder structure:

    └── legislators.csv

You can see an example of the project structure on the Github repo, though you'll have to download each file individually if you want to test it on your own: