← Back to the lab

Note

How this lab works

The workshop blueprint before the first experiment. Open data, Apache Airflow pipelines and a site that updates itself.

By ·

This is where I publish experiments: a simulation, a mini-game, a dashboard or a technical note. This first one is not an experiment. It is the blueprint of the workshop where the rest will be built.

From open data to the experiment pageOpen datahealth · INEGI · CONAPO · Banxico · CDMXProcessing · Apache Airflowextracts, cleans and modelsone DAG per projectData storeraw and processedSite APIHTTPS + token · ready data onlySite databasewhat the experiments showLabone page per experimentGitHubnew codeautomatic deploystore · readpublishesreads live

The pieces

  • Open data. Public sources from the Mexican government: health, INEGI (national statistics), CONAPO (population), Banxico (central bank) and Mexico City. Every experiment cites its source and cutoff date.
  • Processing with Apache Airflow. Each project has its own DAG that extracts, cleans and models the data on a schedule.
  • Data store. It keeps raw and processed data. It is the source of truth and the backup.
  • Site API. It receives, over HTTPS and with a token, only the data that is ready to publish.
  • Site database. It stores only what the experiments show, not the whole data store.
  • The site. Pages read that data live, so new data does not require republishing the site. New code arrives from GitHub and deploys automatically.

Three rules

  1. Public data only, always with source and cutoff date.
  2. No institutional data from my job.
  3. The public database stores only what is shown.

What comes next

First came the site and the blueprint. Next is the first pipeline: check which open sources are still active, connect them to Airflow and publish the first dashboard.