The following is a collaboration piece between Cam Linke, co-founder of Startup Edmonton, and the folks at Real Python.
Updated 02/22/2015: Added Python 3 support.
Welcome! Today we’re going to start building a Flask app that calculates word-frequency pairs based on the text from a given URL. This is a full-stack tutorial.
Part One: Setup a local development environment and then deploy both a staging environment and a production environment on Heroku. (current)
Part Two: Setup a PostgreSQL database along with SQLAlchemy and Alembic to handle migrations.
Part Three: Add in the back-end logic to scrape and then process the counting of words from a webpage using the requests, BeautifulSoup, and Natural Language Toolkit (NLTK) libraries.
Part Four: Implement a Redis task queue to handle the text processing.
Part Five: Setup Angular on the front-end to continuously poll the back-end to see if the request is done.
Part Six: Push to the staging server on Heroku – setting up Redis, detailing how to run two processes (web and worker) on a single Dyno.
Part Seven: Update the front-end to make it more user-friendly.
Part Eight: Add the D3 library into the mix to graph a frequency distribution and histogram.