Skip to main content
    listerineh.dev
    • About
    • Experience
    • Projects
    • Skills
    • Blog
    • Talks
    • Contact
    • Why
    • About
    • Experience
    • Projects
    • Skills
    • Blog
    • Talks
    • Contact
    • Why

    © 2026 Sebastian Alvarez

    All projects

    Football Data Pipeline

    A scheduled pipeline that turns Copa Libertadores and Sudamericana pages into quality-checked Parquet with DuckDB and serves it through an API, with its AWS infrastructure in Terraform.
    Source Code
    Football Data Pipeline
    Role
    Data Engineer
    Timeline
    November 2026
    Status
    In Progress

    In numbers

    Duplicate rows, against 1,055 in the old scraper
    00
    To parse and validate 24 seasons of pages
    0.280.28s
    Home wins when the home city is 2,500 m or more higher
    56%56%
    Full scheduled run end to end on Floci, a local AWS emulator
    39.139.1s

    About the Project

    Football Data Pipeline replaces my two one-off football scrapers with a pipeline that can run every week. Running its quality rules over the old scraper's output showed that 1,055 of its 2,436 Libertadores rows, 43%, were duplicates, and that it still missed 277 matches.

    The ingest job fetches the Libertadores and Sudamericana pages for 2014 to 2025 from Wikipedia, one request per second, and stores the raw HTML before parsing it. The parser finds match tables by their header text instead of their position, labels each match with its stage, and expands two-legged ties into two matches. Every row is either valid or sent to quarantine with its reasons: a team that looks like a date, an unparsed score, a match not played, a duplicate. A transform job then uses DuckDB to join each team's city and altitude and write partitioned Parquet, and a FastAPI app reads that Parquet with DuckDB to answer queries. On AWS it is EventBridge Scheduler, Step Functions, three Lambda functions, S3 and API Gateway, all in Terraform modules that CI formats, validates, lints, scans with trivy and tests with a mocked provider. The same Terraform modules also deploy to Floci, a local AWS emulator, and CI runs the whole schedule there on simulated data: the state machine finished in 39.1 seconds, all 249 rows passed the quality checks, and the API answered in about 50 ms through the emulated API Gateway. Those are emulator figures, not AWS ones; the 24-season numbers come from local runs.

    I built it in November 2026, first to fix the data and then because it is a good small example of data engineering on AWS. The market values stayed out on purpose: Transfermarkt's terms forbid automated scraping. One early result, which is data and not a causal claim: home teams playing 2,500 meters or more above their visitors won 56% of their matches.

    Technologies
    1. API & backend

      • Python
      • FastAPI
    2. Data

      • DuckDB
    3. Cloud & infra

      • AWS Lambda
      • Step Functions
      • S3
      • Terraform

    Relevance

    Data engineering with quality as a feature: raw data kept for replay, explicit quarantine, partitioned Parquet, and AWS infrastructure as tested code.

    How it works

    The path a request takes, step by step.

    1. 01 · ServiceSchedulerEventBridge, weekly, through Step Functions
    2. 02 · ServiceIngestLambda fetches 24 pages and keeps the raw HTML
    3. 03 · ServiceQualityValid rows, or quarantine with reasons
    4. 04 · DataTransformDuckDB writes partitioned Parquet to S3
    5. 05 · ResultAPIFastAPI and DuckDB behind API Gateway
    Step Functions retries each job and a failed run raises an alarm. A parser fix replays over the stored HTML without fetching Wikipedia again.

    Decisions

    The choices that shaped it, and what each one cost.

    1. 01

      Keep the raw HTML

      Why
      Pages are stored before parsing, so a parser fix can be replayed over every season without fetching Wikipedia again.
      What it cost
      About 26 MB of HTML per full run.
    2. 02

      Quarantine, never drop

      Why
      The old scripts skipped what they could not parse, which hid the duplicates. Here every rejected row is written with its reasons and counted.
      What it cost
      Someone has to read the quarantine; two rows sit there today.
    3. 03

      DuckDB instead of dbt or Spark

      Why
      The dataset is a few thousand rows. DuckDB reads JSON and S3 and writes partitioned Parquet from SQL inside a Lambda.
      What it cost
      No lineage view or model tests like dbt would give.
    4. 04

      Wikipedia only on the schedule

      Why
      Transfermarkt’s terms forbid automated scraping, so the market values stayed out of the pipeline.
      What it cost
      The altitude table cannot weigh in squad value anymore.

    Next project

    KairoOpen-source tasks for iOS and Android. Shared calendars, realtime sync with friends, and focus tools for ADHD.Next project
    listerineh.dev

    Full-stack engineer building AI agents, cloud platforms and web products. Based in Quito, working remotely.

    Open to new projects

    Work

    • Projects
    • Experience
    • Skills
    • Blog
    • Talks

    About me

    • About
    • Why Listerineh?
    • Contact

    Connect

    • GitHub
    • LinkedIn
    • Instagram
    • Email

    © 2026 Sebastian Alvarez · All rights reserved.

    • Privacy Policy
    • Terms of Use
    • Unsubscribe from the newsletter
    • Component Library