Data EngineeringCase Study Deep Dive5 min read

How to Turn Government CSV Data Into an Interactive Open Data Portal

Short answer: To turn CSV files into a usable public data portal, don't publish the files. Clean them through an ETL pipeline into a properly indexed database. Serve that data through fast, server-side tables and interactive charts, expose a secure API for developers and journalists, and give staff a self-service screen to upload and publish new datasets. That is how Shrijan Tech helped a US state government agency turn more than 500,000 rows of CSV data into a transparency portal that citizens actually use.

The project summary is in our government data portal case study. Below is the method, which applies to any public body, NGO or company that publishes data.

Why isn't "download the CSV" good enough?

Publishing raw spreadsheets technically makes data public, but in practice almost nobody can use it:

  • Large files are slow to download and impossible to open on a phone.
  • Schemas change between years, so comparing 2021 with 2024 means manual cleanup.
  • Duplicates, missing metadata and inconsistent formats make the numbers unreliable.
  • Journalists and developers have no programmatic way to query the data.
  • Every update needs a developer, so data goes stale.

Our client had all five problems. The aim was to make the data searchable, viewable and visually meaningful for citizens, researchers and journalists, and easy for non-technical staff to keep current.

Step 1: Build an ETL pipeline, not a one-off import

New CSVs keep arriving, so the import has to be repeatable. Our ETL (extract, transform, load) pipeline does the following for every file:

  • Validates it: required columns present, types correct, values in range.
  • Normalises it: consistent dates, units, names and codes across years.
  • De-duplicates records that appear in more than one file.
  • Maps columns automatically to a canonical schema, so a renamed column in next year's file doesn't break anything.
  • Loads the result into consistent MySQL tables, administered through phpMyAdmin.

More than 500,000 records were structured this way.

Step 2: Design the database for the questions people ask

Citizens filter by year, region and category, and compare over time. We indexed the tables around exactly those filters and added caching for common views. Together with server-side processing, that made data access about 60% faster than the previous download-the-CSV approach.

Step 3: Serve tables server-side

Sending 500,000 rows to a browser and filtering there doesn't work, especially on phones. We built custom WordPress plugins in PHP that render DataTables with server-side processing. Sorting, searching and pagination happen in the database, so the browser only receives the rows on screen. Tables stay fast and fully responsive on any device.

Step 4: Make the data visual

Most people understand a chart faster than a table. Using Chart.js, we added pie charts, bar charts and time-series graphs with year-wise filtering and dynamic legends, plus CSV and PDF export for anyone who needs the underlying numbers. Public engagement (page interactions and time on page) rose 45%.

Step 5: Offer a secure API

A portal serves people. An API serves the apps, newsrooms and partner dashboards that reach many more people. We built RESTful APIs with token-based authentication so third parties can query the data without database credentials, with rate limiting and role-based access protecting sensitive endpoints. External apps and internal tools started using the API within six weeks of launch.

Step 6: Let staff publish without developers

A data portal is only as good as its freshness. Inside WordPress we built an admin flow where staff:

  1. Upload a new CSV,
  2. Map its columns to fields,
  3. Review an automatic validation report, and
  4. Publish in one click.

Dataset publishing became about 70% faster, with no developer in the loop for routine updates.

Step 7: Harden it

Public sites attract abuse. We applied input sanitisation, rate limiting, role-based access, query optimisation and caching so the portal stays secure and responsive under load.

Results

  • 500,000+ records structured from legacy CSVs
  • 60% faster data access
  • 45% increase in public engagement
  • 70% lower admin overhead for publishing
  • API adoption by third parties within six weeks
"Shrijan Tech transformed how we publish public records. What used to be a manual, error-prone process is now streamlined, searchable, and visually meaningful, and our staff can update datasets without needing developers." (Director of Digital Transformation, Government Authority)

Open data portal checklist

  1. Every dataset goes through validation and normalisation before publishing.
  2. Column changes between years are handled by mapping, not by hand.
  3. Tables are paginated and filtered server-side.
  4. Key datasets have charts with time filters.
  5. Users can export what they see as CSV or PDF.
  6. Developers get an authenticated, rate-limited API.
  7. Non-technical staff can publish updates themselves.
  8. The site works well on a phone.
  9. Inputs are sanitised and admin access is role-based.

Frequently asked questions

What is the best way to publish government data online?

Load cleaned data into a database and present it through searchable tables, charts and an API, rather than posting raw spreadsheets. Keep downloads available for people who want them, but don't make them the only option.

Can you build an open data portal on WordPress?

Yes. In this project WordPress handles pages, permissions and the staff publishing screen, while custom PHP plugins, an indexed MySQL database, a REST API and Chart.js do the data work. Staff already knew WordPress, which made handover simple.

How do you handle CSV files with different columns each year?

Map every file to one canonical schema during import. The ETL pipeline matches incoming columns to known fields, flags anything it can't match for staff to confirm, and stores everything in consistent tables so year-over-year comparisons just work.

How large a dataset can this approach handle?

This portal serves more than 500,000 records with fast, server-side tables. With proper indexing and caching, the same architecture scales to millions of rows. Beyond that, a dedicated analytics database can sit behind the same front end.

Does Shrijan Tech work with public sector organisations?

Yes. We build data portals, dashboards and data pipelines for public bodies and mission-driven organisations. See our AI & Data Solutions service or get in touch to discuss your datasets.

Ready To Scale With Confidence

Let’s design technology that secures today and powers tomorrow.

  1. 1Contact Info
  2. 2Services
  3. 3Budget & Timeline
  4. 4Project Details
  5. 5Submit
Let's get to know you

We'll need some basic information to get started

Step 1 of 4