All Projects

🎫 KL State Lottery Data Hub

The most robust, independent, and historically complete verification platform for Kerala State Lottery draws. Powered by a Python data pipeline that ingested and normalized years of historical PDF results into a relational database, it offers lightning-fast result verification and detailed statistical analysis on Cloudflare Workers.

Type Web Application
Status ● Live
Scope 2017 – Present

What This Data Hub Is For

The KL State Lottery Data Hub is an independent search, verification, and analytics engine. It enables ticket buyers to instantly verify their numbers across multiple historical draws and view comprehensive prize distributions without manually reviewing scanned or text-formatted PDF sheets.

This is an independent media and analytics service. It is not affiliated with, endorsed by, or operated by the Government of Kerala or the Directorate of State Lotteries. All statistical visualizations shown on the site are based on historical archived draw data, acting as a clean public utility rather than a prediction or purchase advisory tool.

The Problem It Solves

The Kerala State Lottery Department publishes daily draw results as flat, unstructured PDF files. For everyday users wishing to verify old tickets, or researchers investigating historical trends, searching these files is a friction-filled, manual chore.

Additionally, historical PDF documents published over the last two decades present structural and layout inconsistencies, containing scanning errors, typographical deviations, changing serial structures, and irregular table grids. This project solves that fragmentation by providing a standardized, structured, and relational archive that index-caches every draw row.

The Python Data Pipeline

The foundation of the project is a custom data pipeline built in Python to download, parse, clean, and ingest results:

  • Document Crawling — Periodically crawls official sites using BeautifulSoup to pull newly published daily PDF results.
  • PDF Text Extraction — Employs advanced PDF querying rules to parse tabular draw data, identifying winning numbers, prize tires, and agent codes.
  • Layout Normalization — Handles decades of structural shifts, table cell merges, multi-column ticket layouts, and character coding variations in the source documents.
  • Database Ingestion — Sanitizes and maps parsed records into a relational database, applying primary keys and structured relations for rapid, indexable querying.

Key Features

  • Instant Result Verification — Search any ticket series and number to check winning status and prize tiers across multiple draws instantly.
  • Historically Complete Archive — A fully searchable relational directory of draws spanning historically from 2017 to the present day.
  • Visual Statistics & Analytics — Clean dashboards reflecting draw frequencies, winning ticket series distributions, and historical trends.
  • Serverless & Global Scaling — Fast edge rendering and API responses backed by serverless cloud compute.

Tech Stack

Frontend & Web

Next.js / React TypeScript TailwindCSS Chart.js / Recharts

Data & Hosting

Python Pipeline PostgreSQL / D1 Cloudflare Workers GitHub Actions AI-Assisted