Skip to content
OnlyProjects
BCA · Data Science & AnalyticsFor educational purposes only
Code included

Onion and Tomato Mandi Price Analytics and Short-Term Forecasting from Agmarknet Data (Python, Power BI)

Three years of APMC arrivals and prices for two crops — cleaned, charted in Power BI and forecast one week ahead

Mapped to your syllabusBCU SEP 2024 · 24BCAPJ Project · Semester 5

Overview

1 min read

Mandi Price Analytics and Short-Term Forecasting is a data-analytics project built on Agmarknet, the Government of India portal that publishes daily wholesale prices and arrivals from APMC markets across the country. It turns that public data into something a small market committee or an FPO can actually use: a clean local price database, seasonality and volatility analysis, a one-week-ahead price forecast and dashboards that answer questions traders currently answer from memory.

The project tracks two crops with very different behaviour — onion (storable, prone to seasonal spikes and policy shocks such as export duties) and tomato (highly perishable, sharp gluts and crashes) — across six Karnataka markets: Bengaluru, Kolar, Hubballi, Mysuru, Chitradurga and Belagavi. Three years of daily records (arrivals in quintals; minimum, maximum and modal price) are downloaded as Agmarknet report files, cleaned with pandas, loaded into a MySQL staging database, and analysed.

Four forecasting methods of increasing sophistication — seasonal naive, three-week moving average, Holt's exponential smoothing and a SARIMA model from statsmodels — are compared by walk-forward validation using MAPE and RMSE, so the recommendation is earned by measurement rather than fashion. Power BI Desktop dashboards present price trends, a month-by-month seasonality heatmap, the arrivals-versus-price relationship and forecast-versus-actual charts, plus a two-page printable market bulletin.

The project maps directly onto the BCU Sem 5 Project (24BCAPJ) and the 24BCA52 Data Analytics and 24BCA63 Data Mining courses: real government data, honest cleaning decisions, statistical reasoning and a dashboard deliverable — exactly the combination examiners like to question.

Relevant for
Karnataka
Level
Intermediate · 14 weeks · team of 3
Common at
Bengaluru City University, Bangalore University, IGNOU, GGSIPU
Updated
Nov 2026

Syllabus alignment

BCU · SEP 2024

24BCAPJ · Project · Semester 5 · 6 credits · 150 = SEE 120 (writing 20 + demo 60 + viva 20 + report 20) + IA 30 (3 reviews × 10)

Subjects this project applies
  • 24BCA52 Data Analytics (Python + Power BI)
  • 24BCA63 Data Mining
  • DBMS (MySQL)
  • 24BCA61 Machine Learning
How it is evaluated

Team: individual or group ≤ 3

hardbound report; open-source / licensed tools must be acknowledged

Also fits: IGNOU BCA (revised) — BCSP-064 guidelines, MDSU CBCS 2024, GGSIPU 4-year BCA 2024.

What's in the box

11 parts · 5 free · 2 previewed · 4 unlock for ₹2,000

Problem & synopsis

5 min read

Problem statement

Onion and tomato are the two crops whose wholesale prices hurt Indian consumers and growers most when they swing. The public data that could explain these swings already exists on Agmarknet, but it is published as one-day flat reports: local traders, FPO staff and students who want to understand price behaviour must download files day by day, and even then they have no clean history, no seasonal profile, no measure of volatility and no short-term forecast. Decisions — when to harvest and truck a tomato crop, whether to store onions — rest on anecdote.

There is a need for a reproducible analytics pipeline that converts public Agmarknet reports into a clean, queryable price database, measures how prices and arrivals behave across markets and months, tests which simple forecasting method actually predicts the next week best, and presents all of it in dashboards that a non-programmer can open and read.

Synopsis

Abstract

Wholesale prices of onion and tomato in Karnataka move sharply within a season, yet the people who trade in them mostly read yesterday's Agmarknet table without any historical view. This project builds a reproducible analytics pipeline over three years of Agmarknet daily records for six Karnataka APMC markets: it cleans and stores the data in MySQL, quantifies seasonality, volatility and the arrivals–price relationship, compares four short-term forecasting methods by walk-forward validation, and publishes Power BI dashboards and a fortnightly market bulletin. The best method is selected by measured MAPE and RMSE, not assumption.

Introduction

Agmarknet, run by the Directorate of Marketing & Inspection under the Ministry of Agriculture and Farmers Welfare, records daily arrivals (quintals) and prices (rupees per quintal) for thousands of mandis. The raw reports are flat tables meant for a single day's query: no history, no derived measures, no visual summary. An FPO in Kolar deciding whether to move its tomato crop this week or the next, or a trader in Hubballi planning onion storage, must mentally combine fragmented knowledge of festival demand, harvest waves and rain damage.

Existing system and gap

  • Price information is consumed one day at a time; nobody in the local market keeps a structured multi-year history.
  • Volatility is discussed anecdotally ("tomato crashed after Diwali last year") with no numbers behind it.
  • Published forecasting studies usually model one market's series with heavy techniques, often on private or scraped datasets, and rarely ship a reproducible pipeline or a dashboard a non-programmer can open.
  • Small FPOs and market committees cannot afford commercial commodity-analytics subscriptions.

Proposed system

  • A cleaning pipeline in pandas that deduplicates records, removes rows where the modal price falls outside the min–max range, normalises units and leaves market-holiday gaps as explicit gaps rather than invented values.
  • A MySQL staging database (markets, commodities, daily prices, forecast runs) that both the analysis scripts and Power BI query.
  • Descriptive analytics: monthly seasonality profiles, coefficient of variation by market, arrivals-versus-price scatter and correlation, festival-window comparisons.
  • Forecasting engine: seasonal naive, 3-week moving average, Holt's linear method and SARIMA, each validated walk-forward over the final 26 weeks; errors reported as MAPE and RMSE per market and crop.
  • Power BI dashboards with drill-down from state to market, a seasonality heatmap, forecast-vs-actual charts and a printable two-page bulletin.

Feasibility

  • Technical: Agmarknet report downloads need only a browser; pandas, statsmodels, MySQL Community Server and Power BI Desktop are free and run on an ordinary student laptop with 8 GB RAM.
  • Economic: zero licence cost. All tools are open-source or free desktop editions; the only recurring input is internet time for the report downloads.
  • Operational: the market committee or FPO sees a Power BI file, not code; refreshing it weekly is a five-minute job after the download step. The pipeline is documented so the next batch can extend it.

Objectives

  1. 01Download and consolidate three years of Agmarknet daily price and arrival records for onion and tomato across six Karnataka APMC markets.
  2. 02Clean the raw reports with documented pandas rules: duplicate removal, modal-price sanity checks, unit normalisation and explicit handling of missing market days.
  3. 03Design a normalised MySQL staging schema (markets, commodities, daily prices, forecast runs) that serves both analysis scripts and Power BI.
  4. 04Quantify monthly seasonality, volatility (coefficient of variation) and the correlation between arrivals and modal price for each crop and market.
  5. 05Implement four forecasting methods — seasonal naive, 3-week moving average, Holt's exponential smoothing and SARIMA — and compare them by walk-forward validation.
  6. 06Publish Power BI dashboards (price tracker, seasonality heatmap, arrivals versus price, forecast versus actual) and a printable fortnightly market bulletin.
  7. 07Document the whole pipeline so that another student batch can extend it to more commodities or states without rewriting it.

Scope

In scope

  • Two commodities (onion, tomato) and six Karnataka markets (Bengaluru, Kolar, Hubballi, Mysuru, Chitradurga, Belagavi).
  • Three years of daily wholesale records: arrivals in quintals, minimum, maximum and modal price in ₹/quintal, as published on Agmarknet.
  • Daily and weekly aggregation views; one-week-ahead forecasts from four methods with walk-forward validation over the final 26 weeks.
  • Power BI dashboards and a two-page printable bulletin; CSV export of cleaned data and forecast metrics.

Out of scope (v1)

  • Retail prices, farm-gate prices and price transmission between wholesale and retail.
  • Other states' markets and other commodities (the schema supports them, but data collection stays limited).
  • Deep-learning models (LSTM), intraday or e-auction data, and any buy/sell recommendation — the project informs, it does not advise.

Methodology

The team follows the Incremental (iterative) SDLC model: each increment ends with a demo to the guide, and feedback is folded into the next increment. This suits a 14-week Sem 5 timeline in which data availability — not coding difficulty — is the main risk, so the data pipeline is built first.

PhaseWeeksActivitiesDeliverable
Requirement study1Study Agmarknet report formats; interview an FPO/trader about decisions they take; finalise crops, markets, periodRequirement list
Data collection2–3Download three years of daily reports for both crops and all six markets into data/rawRaw CSV set
Design4MySQL schema, cleaning rules, forecast-method list, dashboard wireframeDesign note
Increment 15–6ETL scripts in pandas; load MySQL; data-quality reportClean database
Increment 27–9Exploratory analysis (seasonality, volatility, arrivals–price); figuresAnalysis notebook
Increment 310–11Forecasting engine, walk-forward validation, metrics tableforecasts.csv, metrics.csv
Dashboards12Power BI model, four report pages, bulletin layout.pbix + bulletin
Testing & docs13Unit tests for cleaning rules; reproducibility dry-run on a fresh laptopTest report
Report & demo14Hardbound report, PPT, rehearsalFinal submission

Testing approach: unit tests (pytest) assert the cleaning invariants — no duplicate market–commodity–date rows, modal price always within min–max, arrivals non-negative; a reproducibility dry-run rebuilds the database from raw CSVs on a teammate's laptop; forecast quality is judged only on the held-out walk-forward window, never on the training period.

Architecture & tech stack

2 diagrams · 6 technologies · 2 min read

  • Python 3
  • pandas
  • Matplotlib / Seaborn
  • statsmodels (SARIMAX)
  • MySQL
  • Power BI Desktop

The system is a batch analytics pipeline with four layers: acquisition, staging, analysis and presentation. Raw Agmarknet report files land in a versioned folder; a pandas ETL script cleans and loads them into MySQL; Python analysis scripts and the forecasting engine read from MySQL and write results back; Power BI connects to the same MySQL server for all visuals. Keeping MySQL at the centre means the dashboard never depends on a script running first.

flowchart LR
  A["Agmarknet report downloads (CSV)"] --> B["data/raw folder"]
  B --> C["pandas ETL: dedupe, sanity checks, unit normalisation"]
  C --> D[("MySQL: markets, commodities, daily_prices, forecast_runs")]
  D --> E["Exploratory analysis (pandas, Matplotlib)"]
  D --> F["Forecasting engine: seasonal naive, MA, Holt, SARIMA"]
  F --> G["metrics.csv + forecasts.csv"]
  G --> D
  D --> H["Power BI Desktop dashboards"]
  H --> I["Two-page market bulletin (PDF)"]

Staging database — ER diagram

erDiagram
  MARKET ||--o{ DAILY_PRICE : has
  COMMODITY ||--o{ DAILY_PRICE : "is priced as"
  DAILY_PRICE ||--o{ QUALITY_LOG : "passed or failed checks"
  DAILY_PRICE ||--o{ WEEKLY_PRICE : "aggregates into"
  COMMODITY ||--o{ FORECAST_RUN : "is forecast"
  MARKET ||--o{ FORECAST_RUN : "per market"

  MARKET {
    int market_id PK
    string name
    string district
  }
  COMMODITY {
    int commodity_id PK
    string name
    string group_name
  }
  DAILY_PRICE {
    int price_id PK
    int market_id FK
    int commodity_id FK
    date price_date
    decimal arrivals_quintal
    decimal min_price
    decimal max_price
    decimal modal_price
  }
  WEEKLY_PRICE {
    int week_id PK
    int market_id FK
    int commodity_id FK
    date week_start
    decimal avg_modal_price
    decimal total_arrivals
  }
  FORECAST_RUN {
    int run_id PK
    int market_id FK
    int commodity_id FK
    string method
    date forecast_week
    decimal predicted_price
    decimal actual_price
    decimal mape
    decimal rmse
  }
  QUALITY_LOG {
    int log_id PK
    int price_id FK
    string check_name
    string action
  }

A QUALITY_LOG table records every row the ETL dropped or corrected and why, which is the audit trail examiners ask about when they probe data cleaning. The pipeline is deliberately file-driven, so the whole study can be replayed offline on viva day with no internet dependency.

Modules

6 modules

  1. Module 01

    Member 1 — Data acquisition and cleaning (ETL)

    Downloads three years of Agmarknet daily reports for both crops and six markets, then implements the pandas pipeline: parse heterogeneous report formats, drop exact duplicates, reject rows where modal price lies outside min–max, normalise units to ₹/quintal, and log every rejected row to QUALITY_LOG with a reason.

  2. Module 02

    Member 1 — MySQL staging database

    Designs and creates the normalised schema (MARKET, COMMODITY, DAILY_PRICE, WEEKLY_PRICE, FORECAST_RUN, QUALITY_LOG), writes the bulk-load script with parameterised inserts and index creation on market–commodity–date, and prepares the weekly aggregation view that Power BI reads.

  3. Module 03

    Member 2 — Exploratory analytics

    Builds the analysis notebook that computes monthly seasonality profiles per market, coefficients of variation, year-on-year comparisons, the arrivals-versus-modal-price scatter and Pearson correlation, and festival-window (Diwali, Ganesh Chaturthi) price behaviour, exporting publication-quality Matplotlib/Seaborn figures for the report.

  4. Module 04

    Member 2 — Forecasting engine and validation

    Implements the four forecast methods on weekly modal-price series using pandas and statsmodels SARIMAX, runs them in strict walk-forward fashion over the final 26 weeks, and writes forecasts.csv and metrics.csv (MAPE, RMSE per crop–market–method) plus a short justification of the winning method.

  5. Module 05

    Member 3 — Power BI dashboards

    Connects Power BI Desktop to the MySQL staging database, builds the data model and DAX measures, and designs four report pages — price tracker with market drill-down, month-by-market seasonality heatmap, arrivals versus price scatter, and forecast-versus-actual comparison — plus slicers for crop, market and date range.

  6. Module 06

    Member 3 — Market bulletin and documentation

    Lays out the printable two-page bulletin (current prices, four-week trend arrow, next-week forecast band, seasonality note), exports it to PDF, and maintains the project README and data-quality report so the pipeline can be re-run and extended by the next batch without help.

Slides

12 slides · titles free · bullets, notes and the .pptx unlock

  1. Slide 1

    Mandi Price Analytics & Short-Term Forecasting from Agmarknet Data

  2. Slide 2

    Background and Motivation

  3. Slide 3

    Problem Statement

  4. Slide 4

    Objectives

  5. Slide 5

    Data Source and Cleaning

  6. Slide 6

    System Architecture

  7. Slide 7

    Database Design

  8. Slide 8

    Exploratory Findings

  9. Slide 9

    Forecasting and Validation

  10. Slide 10

    Power BI Dashboards and Bulletin

  11. Slide 11

    Testing and Reproducibility

  12. Slide 12

    Conclusion, Limitations and Future Scope

Bullets, speaker notes and the .pptx · ₹2,000

The titles above are the real outline. The rest is what you present from.

Unlock for ₹2,000

Viva questions & answers

3 of 15 answered free · 12 unlock

Read each answer, close it, and say it in your own words. Your viva will ask. Now you'll know.

  1. 01Concept

    What is the modal price on Agmarknet and why did you analyse it instead of the average of min and max?

    Modal price is the price at which the largest trade volume happened on that market day, so it represents where the market actually cleared. A simple average of minimum and maximum is distorted by a few small or distressed lots at the extremes, so modal price is the better central measure for analysis.

  2. 02Concept

    Why does onion behave so differently from tomato in your data?

    Onion is storable for weeks, so traders buffer supply and prices rise in lean months and after policy events like export duties, giving seasonal patterns. Tomato is highly perishable with no effective buffer, so a few days of excess arrivals crash the price, producing sharper short-lived swings and a stronger negative arrivals–price correlation.

  3. 03Concept

    What exactly do MAPE and RMSE measure, and why report both?

    MAPE is the mean absolute percentage error, which is easy to read across crops because it is scale-free. RMSE is in rupees per quintal and penalises large misses more heavily. A method can look acceptable on MAPE while producing one disaster week that RMSE exposes, so we report both and discuss them together.

+12 more questions, with answers

Try the free ones out loud first. Your examiner will not accept “it's in the PPT”.

Source code & how to run

7 steps · complete source code · unlocks with the project

Unlocks with the project · ₹2,000

7 steps · source code zip

Prerequisites, install, seed data and tests, written for demo day. Plus the complete source.

Unlock for ₹2,000

READMEFIRST

293 words · unlocks with the project

What to change before it goes anywhere near a submission. Skipping it is how the demo fails live.

Unlocks with the project · ₹2,000

293 words · ~1 min read

The checklist of things to rename, re-seed and re-think so the project reads as yours.

Unlock for ₹2,000

Instructions

404 words · unlocks with the project

How to study it, adapt it and walk your examiner through it, step by step.

Unlocks with the project · ₹2,000

404 words · ~2 min read

Report structure, formatting rules and the submission checklist your department will grade.

Unlock for ₹2,000

References

8 sources

  1. Agmarknet — Market Intelligence Portal, Directorate of Marketing & Inspection, Ministry of Agriculture and Farmers Welfare, Government of India
  2. Current Daily Price of Various Commodities from Various Markets (Mandi) — data.gov.in dataset
  3. Hyndman RJ, Athanasopoulos G. Forecasting: Principles and Practice, 3rd ed. OTexts (free online edition)
  4. statsmodels Documentation — SARIMAX and time-series analysis
  5. pandas Documentation
  6. Power BI Desktop documentation — Microsoft Learn
  7. MySQL 8.0 Reference Manual
  8. Han J, Kamber M, Pei J. Data Mining: Concepts and Techniques, 3rd ed. Morgan Kaufmann

Cite this bundle

OnlyProjects. (2026). Onion and Tomato Mandi Price Analytics and Short-Term Forecasting from Agmarknet Data (Python, Power BI): BCA Data Science & Analytics project bundle [Educational resource]. https://onlyprojects.online/projects/bca-ds-mandi-price-analytics-forecasting-agmarknet

Future scope

1 min read

  • Automated daily ingestion — a scheduled script that pulls the latest Agmarknet reports each morning so the dashboard is always current.
  • More crops and states — the schema already supports commodity and market dimension growth; potato and green chilli are natural additions.
  • Richer models — gradient-boosted regressors with arrival and festival features, and an LSTM comparison for the report's discussion chapter.
  • Bulletin bot — the two-page bulletin pushed as a WhatsApp message to FPO members every fortnight.
  • Price-transmission study — linking these wholesale series with retail CPI data to examine how much of a wholesale spike reaches the consumer.
  • Multi-year backtesting service — a small web front end where a user picks a market, commodity and method and receives the backtest report.

Keep browsing

Same degree, same syllabus slot, different idea. Pick the one your guide will actually approve.

BCACode included

Web Development

Smart Hostel Management System

Room allocation, complaints and mess billing without the register

  • Next.js
  • TypeScript
  • Node.js
  • +3

intermediate8 wk2 students