All projects

Technical Report · Web & Data Applications

Swiggy Map Plotter

Python data-visualization experiment that processes Swiggy order/tracking coordinates and plots them as interactive geographic markers with Plotly.

AUTHOR  Gaurav Verma CATEGORY  Web & Data Applications SOURCE  https://github.com/gaurav-321/swiggy_map_plotter DATE  Nov 2022 STATUS  published
View Source Python Requests Pandas Plotly Data Visualization Mapping

Abstract

A two-script Python pipeline that pulls Swiggy order-tracking coordinates via Requests, normalizes them into a Pandas table, and renders an interactive Plotly scatter map. The interesting part is the clean split between data acquisition and rendering: the plotting script only ever sees a tidy coordinate table, so it is agnostic to how the data was fetched.

1. What This Is

I built this as a small experiment in geographic data handling. The repository contains two scripts: one that retrieves and processes Swiggy order/tracking data into a coordinate table, and a second that takes that table and produces an interactive Plotly map with varied markers so individual points are easier to distinguish.

The stack is deliberately minimal — Python, Requests for HTTP retrieval, Pandas for tabular cleaning, and Plotly for the interactive output. No web framework, no database; the whole thing runs as a local script pair.

2. How It Works

The pipeline is linear. The acquisition script handles everything up to a clean DataFrame; the plotting script picks up from there.

# Stage Input Tool Output
01 Retrieve tracking data Swiggy order/tracking endpoint Requests Raw response payload
02 Extract coordinates Raw payload Python Latitude / longitude fields
03 Normalize to table Coordinate fields Pandas Clean DataFrame
04 Build interactive map DataFrame Plotly Scatter/map figure with varied markers
05 Inspect / export Plotly figure Browser / file Interactive HTML or static image

3. Constraints

  • Single-source, single-run

    The pipeline targets one Swiggy data source and one batch of coordinates. There is no incremental ingestion, no persistence layer, and no way to compare runs over time.

  • No error or auth handling

    The Requests call is a plain fetch. If the endpoint changes shape, adds rate-limiting, or requires a session token, the script fails silently or with an unhandled exception.

  • Demo-scale visualization

    Marker variation helps distinguish points, but there is no clustering, time-axis, or filtering. Beyond a few hundred markers the plot becomes hard to read.

  • No tests or CI

    The project is an experiment; there are no unit tests, no linting, and no automated checks. A schema change in the upstream data would go unnoticed until a manual run.

4. Next

  1. a. Add a lightweight persistence step (CSV or SQLite) between acquisition and plotting so the map can be re-rendered without re-fetching.
  2. b. Introduce basic error handling and a retry wrapper around the Requests call, plus a schema check on the incoming payload before it hits Pandas.
  3. c. Extend the Plotly figure with a time slider or region filter so the map can show order density over a date range rather than a single flat snapshot.

— end of report —